Study Program 8.1 carefully, then compile and execute it. [Kaji Program 8.1 dengan teliti, kemudian kompil dan laksana aturcara tersebut.] i. What does the program do? [4pakah yang dilakukan oleh aturcara tersebut?] ii. Why do you need 7 variables to hold the prices of the items? [Mengapa 7 pembolehubah diperlukan untuk menyimpan harga barangan?] Why is the variable totalPrice initialized to 0? [Mengapa pembolehubah totalPrice diberi nilai awal 0?] III. iv. Identify the set of statements that are repeated many times in the program. [Kenalpasti set pernyataan yang diulang beberapa kali dalam aturcara ini.] How many times were the set of statements repeated? [Berapa kalikah set pernyataan tersebut diulang?] V.
Study Program 8.1 carefully, then compile and execute it. [Kaji Program 8.1 dengan teliti, kemudian kompil dan laksana aturcara tersebut.] i. What does the program do? [4pakah yang dilakukan oleh aturcara tersebut?] ii. Why do you need 7 variables to hold the prices of the items? [Mengapa 7 pembolehubah diperlukan untuk menyimpan harga barangan?] Why is the variable totalPrice initialized to 0? [Mengapa pembolehubah totalPrice diberi nilai awal 0?] III. iv. Identify the set of statements that are repeated many times in the program. [Kenalpasti set pernyataan yang diulang beberapa kali dalam aturcara ini.] How many times were the set of statements repeated? [Berapa kalikah set pernyataan tersebut diulang?] V.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
![2.
Study Program 8.1 carefully, then compile and execute it.
[Kaji Program 8.1 dengan teliti, kemudian kompil dan laksana aturcara
tersebut.]
What does the program do?
[Apakah yang dilakukan oleh aturcara tersebut?]
i.
ii.
Why do you need 7 variables to hold the prices of the items?
[Mengapa 7 pembolehubah diperlukan untuk menyimpan harga
barangan?]
Why is the variable totalPrice initialized to 0?
[Mengapa pembolehubah totalPrice diberi nilai awal 0?]
Il1.
iv.
Identify the set of statements that are repeated many times in the
program.
[Kenalpasti set pernyataan yang diulang beberapa kali dalam aturcara
ini.]
How many times were the set of statements repeated?
[Berapa kalikah set pernyataan tersebut diulang?]
V.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fef76bf5a-8cf6-462b-8b54-c1c750f72b1e%2Fa819b3b2-0d46-423a-a007-e35dabfd7e4a%2Fwod35pg_processed.png&w=3840&q=75)
Transcribed Image Text:2.
Study Program 8.1 carefully, then compile and execute it.
[Kaji Program 8.1 dengan teliti, kemudian kompil dan laksana aturcara
tersebut.]
What does the program do?
[Apakah yang dilakukan oleh aturcara tersebut?]
i.
ii.
Why do you need 7 variables to hold the prices of the items?
[Mengapa 7 pembolehubah diperlukan untuk menyimpan harga
barangan?]
Why is the variable totalPrice initialized to 0?
[Mengapa pembolehubah totalPrice diberi nilai awal 0?]
Il1.
iv.
Identify the set of statements that are repeated many times in the
program.
[Kenalpasti set pernyataan yang diulang beberapa kali dalam aturcara
ini.]
How many times were the set of statements repeated?
[Berapa kalikah set pernyataan tersebut diulang?]
V.
![EXERCISE 1:
[LATIHAN I]
Type in the following program (Program 8.1):
[Taip aturcara yang berikut (Program 8.1 ):].
1.
//Program 8.1
#include <stdio.h>
#include <conio.h>
int main()
double pricel,
price6, price7, totalPrice-0;
printf("Program To Calculate The Average and Total
price2,
price3,
price4,
price5,
7
Price of The 7 Items \n \n ");
printf("Enter price of item:
scanf ("$lf", spricel);
totalPrice +- pricel;
printf("Enter price of item:
") ;
10
11
") ;
scanf ("$lf", sprice2);
totalPrice +- price2;
printf("Enter price of item:
scanf ("$lf", sprice3);
totalPrice += price3;
printf("Enter price of item:
13
") ;
15
16
17
") :
scanf ("$lf", sprice4);
totalPrice +- price4;
printf("Enter price of item:
18
19
20
") :
scanf ("$lf", sprice5);
totalPrice +- price5;
printf("Enter price of item:
scanf ("$lf", sprice6);
totalPrice +- price6;
printf("Enter price of item:
scanf ("$lf", sprice7);
totalPrice +- price7;
21
23
") :
24
25
26
") :
27
28
29
printf("\n\nThe Average Price of The Items Is
total Price/7);
printf("\nThe Total Price of The Items Is
totalPrice);
printf("\n\nEnd Of Program");
getch();
return 0;
30
$f",
31
32
SE",
33
34
35
36
37
38
O-2 34
2345n
o a - - --- ---- 122 2222N 222 233 333 3m3
1234 n6](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fef76bf5a-8cf6-462b-8b54-c1c750f72b1e%2Fa819b3b2-0d46-423a-a007-e35dabfd7e4a%2F7a3ta2d_processed.png&w=3840&q=75)
Transcribed Image Text:EXERCISE 1:
[LATIHAN I]
Type in the following program (Program 8.1):
[Taip aturcara yang berikut (Program 8.1 ):].
1.
//Program 8.1
#include <stdio.h>
#include <conio.h>
int main()
double pricel,
price6, price7, totalPrice-0;
printf("Program To Calculate The Average and Total
price2,
price3,
price4,
price5,
7
Price of The 7 Items \n \n ");
printf("Enter price of item:
scanf ("$lf", spricel);
totalPrice +- pricel;
printf("Enter price of item:
") ;
10
11
") ;
scanf ("$lf", sprice2);
totalPrice +- price2;
printf("Enter price of item:
scanf ("$lf", sprice3);
totalPrice += price3;
printf("Enter price of item:
13
") ;
15
16
17
") :
scanf ("$lf", sprice4);
totalPrice +- price4;
printf("Enter price of item:
18
19
20
") :
scanf ("$lf", sprice5);
totalPrice +- price5;
printf("Enter price of item:
scanf ("$lf", sprice6);
totalPrice +- price6;
printf("Enter price of item:
scanf ("$lf", sprice7);
totalPrice +- price7;
21
23
") :
24
25
26
") :
27
28
29
printf("\n\nThe Average Price of The Items Is
total Price/7);
printf("\nThe Total Price of The Items Is
totalPrice);
printf("\n\nEnd Of Program");
getch();
return 0;
30
$f",
31
32
SE",
33
34
35
36
37
38
O-2 34
2345n
o a - - --- ---- 122 2222N 222 233 333 3m3
1234 n6
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education