Following is a problem statement. Which of the below is the correct trace table for the problem statement? Peter bought 18 cupcakes for his sons birthday, they cost R4,50 each. Write a program that will accept the input from the user and then calculate the amount due by multiplying the number of cupcakes by the price and then adding 14% VAT to the amount. Display the final amount he owes on the screen. Select one: a. Instruction quantity price amount vat finalAmount Output display Provide the quantity bought enter 18 display Provide the price of 1 item enter 4.50 calculate 81 11.34 92.34 display The final amount due is R92.34 b. Instruction quantity price amount vat finalAmount Output enter 18 enter 4.50 calculate 81 calculate 11.34 calculate 92.34 display The final amount due is R92.34 c. Instruction quantity price amount vat finalAmount Output display Provide the quantity bought enter 18 display Provide the price of 1 item enter 4.50 calculate 81 calculate 11.34 calculate 92.34 display The final amount due is R92.34 d. Instruction quantity price Output display Provide the quantity bought enter 18 display Provide the price of 1 item enter 4.50 display The final amount due is R92.34
Following is a problem statement. Which of the below is the correct trace table for the problem statement?
Peter bought 18 cupcakes for his sons birthday, they cost R4,50 each. Write a
Instruction |
quantity |
price |
amount |
vat |
finalAmount |
Output |
display |
|
|
|
|
|
Provide the quantity bought |
enter |
18 |
|
|
|
|
|
display |
|
|
|
|
|
Provide the price of 1 item |
enter |
|
4.50 |
|
|
|
|
calculate |
|
|
81 |
11.34 |
92.34 |
|
display |
|
|
|
|
|
The final amount due is R92.34 |
Instruction |
quantity |
price |
amount |
vat |
finalAmount |
Output |
enter |
18 |
|
|
|
|
|
enter |
|
4.50 |
|
|
|
|
calculate |
|
|
81 |
|
|
|
calculate |
|
|
|
11.34 |
|
|
calculate |
|
|
|
|
92.34 |
|
display |
|
|
|
|
|
The final amount due is R92.34 |
Instruction |
quantity |
price |
amount |
vat |
finalAmount |
Output |
display |
|
|
|
|
|
Provide the quantity bought |
enter |
18 |
|
|
|
|
|
display |
|
|
|
|
|
Provide the price of 1 item |
enter |
|
4.50 |
|
|
|
|
calculate |
|
|
81 |
|
|
|
calculate |
|
|
|
11.34 |
|
|
calculate |
|
|
|
|
92.34 |
|
display |
|
|
|
|
|
The final amount due is R92.34 |
Instruction |
quantity |
price |
Output |
display |
|
|
Provide the quantity bought |
enter |
18 |
|
|
display |
|
|
Provide the price of 1 item |
enter |
|
4.50 |
|
display |
|
|
The final amount due is R92.34 |
Step by step
Solved in 3 steps with 1 images