Question: Mountain Coffee wants a program that allows a clerk to enter the number of pounds of coffee ordered, the price per pound, and whether the

Mountain Coffee wants a program that allows a clerk to enter the number of pounds of coffee ordered, the price per pound, and whether the customer should be charged a 3.5% sales tax. The program should calculate and display the total amount the customer owes. Use an int variable for the number of pounds, a double variable for the price per pound, and a char variable for the sales tax information. 

a. Create an IPO chart for the problem, and then desk-check the algorithm twice. For the first desk-check, use 5 as the number of pounds and 13.69 as the price per pound; the customer should be charged the sales tax. For the second desk-check, use 3 as the number of pounds and 11.59 as the price per pound; the customer should not be charged the sales tax. 

b. List the input, processing, and output items, as well as the algorithm, in a chart similar to the one shown earlier in Figure 5-27. Then code the algorithm into a program. 

c. Desk-check the program using the same data used to desk-check the algorithm. 

d. If necessary, create a new project named Introductory11 Project, and save it in the Cpp8\Chap05 folder. Enter your C++ instructions into a source file named Introductory11.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Display the total amount owed in fixed-point notation with two decimal places. Test the program using the same data used to desk-check the program. 

IPO chart information Input discount rate (10%) shipping rate 1 (0.99) shipping rate 2 (4.99) amount owed member status (Y or N) C++ instructions = 0.1; const double DISCOUNT_RATE const double SHIP_CHG1 = 0.99; const double SHIP_CHG2 = 4.99; double amtOwed - 0.0; char member = ''; Processing none Output

IPO chart information Input discount rate (10%) shipping rate 1 (0.99) shipping rate 2 (4.99) amount owed member status (Y or N) C++ instructions = 0.1; const double DISCOUNT_RATE const double SHIP_CHG1 = 0.99; const double SHIP_CHG2 = 4.99; double amtOwed - 0.0; char member = ''; Processing none Output amount owed uses the amtowed variable declared above Algorithm: 1. enter amount owed and member status cout "Amount owed before any discount and shipping: "; cin >> amtOwed; cout member; if (toupper (member) == 'Y') 2. if (member status is Y) calculate amount owed by multiplying amount owed by discount rate and then subtracting the result from amount owed end if amtOwed -- amtOwed * DISCOUNT_RATE; //end if 3. if (amount owed >= 100) add shipping rate i to amount owed else if (amtOwed >= 100.0) amtOwed + SHIP_CHG1; else add shipping rate 2 to amount owed end if amtOwed += SHIP CHG2; //end if 4. display amount owed cout fixed setprecision(2); cout "Amount owed after any discount and shipping:"

Step by Step Solution

3.59 Rating (170 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Input pounds price per pound charged for sales tax Y or N sales tax rate 35 pounds price per pound 1... View full answer

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 Microsoft Visual C# Introduction Questions!