Question: Suppose, you have to write a C++ console application for an ice-cream shop named Icey Ice-creams . Your application has to calculate and display the

Suppose, you have to write a C++ console application for an ice-cream shop named Icey Ice-creams. Your application has to calculate and display the cost of a customers ice-cream purchase. Use a validation loop (using while) to prompt for and get from the user the number of ice-creams purchased in the range 1-100. Take input for the customers name. If customers name starts with I, give him/ her a 10% discount. Calculate the following:

Subtotal using a cost of $2.70 per ice-cream.

Discount if customers name starts with I, else 0

Subtotal after discount

Sale tax using rate of 6%.

Total

Use formatted output manipulators (setw, left/right) to print the following rows:

Ice-cream purchased

Ice-cream cost ($)

Discount (%)

Subtotal ($)

Subtotal after discount ($)

Tax ($)

Total ($)

And two columns:

A left-justified label (including units)

A right-justified value.

Define constants for the ice-cream cost, discount rate, sales tax rate, and column widths. Format all real numbers to two decimal places. Run the program with invalid and valid inputs, including one customer whose name starts with I, and another whose name doesnt start with I.

[your program code here]*

If possible, format your code like this:

Font Courier New

Font size 9

Bold

[your two program output here]**

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!