Question: Q2) Write a program that prompts the user to enter how many items he/she purchased at the grocery store today. Then prompt the user to

 Q2) Write a program that prompts the user to enter how

Q2) Write a program that prompts the user to enter how many items he/she purchased at the grocery store today. Then prompt the user to enter the price for each item. Use a loop structure to read the price of each item. Calculate the total cost. Print the total cost to the screen Sample Output: How many items did you purchase today? 4 Enter the cost of each of the 4 items you purchased: 1.25 1.75

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!