Question: Part 1: Purchases Write a program named prices.c that repeatedly asks users to enter the price of an item until they enter zero. Prices less

 Part 1: Purchases Write a program named prices.c that repeatedly asks
users to enter the price of an item until they enter zero.

Part 1: Purchases Write a program named prices.c that repeatedly asks users to enter the price of an item until they enter zero. Prices less than zero will be ignored. The program will then print the number of items purchased, the subtotal of the prices, the sales tax charged (at a rate of 7.5%), and the grand total. Your program must use a while loop or do/while loop. Here is what a sample run of the program might look like. The cursor for user input must appear on the same line as the input prompt. All monetary values must be displayed with two digits to the right of the decimal point. Enterprise, or zero when finished: $14.95 Enteria prace or zero when finished: $10.66 Enter a price or zero when finished: $ 3.50 Negative price ignored Enterprice, or zero when finished: $8.82 Enter a price or zero when finished: $37.00 Enter a price, or zero when finished: se Number of items purchased: 4 Subtotal $71.43 Sales tax 7.5% $5136 Total $76.79 Part 1: Purchases Write a program named prices.c that repeatedly asks users to enter the price of an item until they enter zero. Prices less than zero will be ignored. The program will then print the number of items purchased, the subtotal of the prices, the sales tax charged (at a rate of 7.5%), and the grand total. Your program must use a while loop or do/while loop. Here is what a sample run of the program might look like. The cursor for user input must appear on the same line as the input prompt. All monetary values must be displayed with two digits to the right of the decimal point. Enter a price, or zero when finished: $14.95 Enter a price, or zero when finished: $10.66 Enter a price, or zero when finished: $-3.50 Negative price ignored Enter a price, or zero when finished: $8.82 Enter a price, or zero when finished: $37.00 Enter a price, or zero when finished: $0 Number of items purchased: 4 Subtotal $71.43 Sales tax 7.5% $5.36 Total $76.79

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!