In this exercise, you will modify the tip program shown earlier in Figure 7-31. Follow the instructions
Question:
In this exercise, you will modify the tip program shown earlier in Figure 7-31. Follow the instructions for starting C++ and viewing the ModifyThis16.cpp file, which is contained in either the Cpp8\Chap07\ModifyThis16 Project folder or the Cpp8\Chap07 folder.
(You may need to open the project/solution file first.) Change the for statement to a while statement. Save and then run the program. Test the program using 90.50 as the restaurant bill. The three tips should appear as shown earlier in Figure 7-32.
Transcribed Image Text:
Problem specification Create a program that allows the user to enter the amount of a restaurant bill. The program should calculate and display the suggested amounts to tip a waiter using rates of 10%, 15%, and 20%. Use a counter to keep track of the three rates. IPO chart information Input C++ instructions double bill = 0.0; rate (counter: 10% to 20% in increments of 5%) in the for clause bill this variable is created and initialízed Processing none Output tip double tip = 0.0; %3D Algorithm 1. enter the bill cout « "Bill amount: "; cin >> bill; 2. repeat for (rate from 10% to 20% in increments of 5%) calculate tip by multiplying the bill by the rate for (double rate = 0.1; rate <= 0.2; rate += 0.05) { tip = bill * rate; %3! cout <« rate * 100 << "% display the rate and tip tip: "; cout <« "$" « tip <« endl; } end repeat //end for Figure 7-31 Problem specification, IPO chart information, and C++ instructions for the tip program
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 72% (11 reviews)
ModifyThis16cpp displays three tip amounts Createdr...View the full answer
Answered By
Fahmin Arakkal
Tutoring and Contributing expert question and answers to teachers and students.
Primarily oversees the Heat and Mass Transfer contents presented on websites and blogs.
Responsible for Creating, Editing, Updating all contents related Chemical Engineering in
latex language
4.40+
8+ Reviews
22+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
In this exercise, you will modify the car depreciation program from Figure 8-12. Follow the instructions for starting C++ and viewing the ModifyThis12.cpp file, which is contained in either the...
-
In this exercise, you will modify the hypotenuse program shown earlier in Figure 9-6.Follow the instructions for starting C++ and viewing the ModifyThis13.cpp file, which is contained in either the...
-
In this exercise, you will modify the savings account program shown earlier in Figure 9-18. Follow the instructions for starting C++ and viewing the Intermediate20.cpp file, which is contained in...
-
Mrs. Ridhima had a factory situated in Delhi which he transferred to Uttar Pradesh and closed all operations in Delhi. Whether it will constitute a slump sale and whether it is liable to tax under...
-
R = 4 with probability 0.5, R = 0.25 with probability 0.5. Find the arithmetic and geometric means of the random variables R for per capita production in the above cases. Check that the...
-
Consider the circuit shown in Figure P26.23, where C1 = 6.00 F, C2 = 3.00 F, and V = 20.0 V. Capacitor C1 is first charged by the closing of switch S1. Switch S1 is then opened, and the charged...
-
In the Kessler International Survey, what was the major motivation for employee fraud? a. Greed b. Need c. Vindictiveness d. Lack of internal controls e. None of the above
-
The management of Tinker Inc. asks your help in determining the comparative effects of the FIFO and LIFO inventory cost flow methods. For 2014, the accounting records show these data. Inventory,...
-
A merchandising company: ?. A merchandising company: earns net income from buying and selling merchandise C buys products from manufacturers and sells to retailers C buys products from manufacturers...
-
1. What type of contact is between the Ridpath Sandstone and the Kavalier Shale? How did you determine this? (Refer to the Geologic Time Scale, which is Figure 1 in the Geologic Dating lab, to help...
-
Create a program that allows the user to enter the ages (in years) of five people. The program should display the average age. Use the for statement. Display the average age with one decimal place....
-
In this exercise, you will modify the sales program from Lab7-2. If necessary, create a new project named ModifyThis17 Project, and save it in the Cpp8\Chap07 folder. Enter (or copy) the Lab7-2.cpp...
-
Scar mack's Paint Company has annual sales of $500,000 per year. If there is a profit of $1000 per day, 6 days per week operation, what is the total yearly business expense? All calculations are on a...
-
For the following provide an example of best practice that is currently being implemented in an early childhood education and care setting regarding environmental responsibility (ER) and cite the...
-
Discuss gender, economic and social justice struggle in Mambety's (1999) THE LITTLE GIRL WHO SOLD THE SUN and Pakleppa's (1997) Sophia's Homecoming. How were struggles different and how were they...
-
Refer to the following TED Talkby Bridget Sampson. Sampson discusses how public speaking skills can unlock human potential. Discuss how Sampson's tips on public speaking can apply to your own career.
-
What do you understand by the introductory statement in the course description, that: "As a global citizen, an understanding of cultural difference and ability to communicate effectively with diverse...
-
Using 300-500 words to explain the following: Answer the following reflective question. Do not include any information that will make you identifiable to your reviewers. Within the realm of this...
-
Fire tower A is 30 kilometers due west of fire tower B. A fire is spotted from the towers, and the bearings from A and B are N 76° E and N 56° W, respectively (see figure). Find the distance...
-
Suppose that you are part of a virtual team and must persuade other team members on an important matter (such as switching suppliers or altering the project deadline). Assuming that you cannot visit...
-
Which of the following clauses will stop the loop when the value in the intPopulation variable is less than the number 5000? a. Do While intPopulation >= 5000 b. Do Until intPopulation < 5000 c. Loop...
-
Which of the following statements can be used to code a loop whose instructions you want processed 10 times? a. DoLoop b. ForNext c. All of the above.
-
The instructions in a _____________________ loop might not be processed at all, whereas the instructions in a _____________________ loop are always processed at least once. a. Posttest, pretest b....
-
1. All overhead valve engines ______________. a. Use an overhead camshaft b. Have the valves located in the cylinder head c. Operate by the two-stroke cycle d. Use the camshaft to close the valves 2....
-
Which version of the sentence uses correct parallel structure? A) Route 83 will be closed for road construction, while Highway 175 will have two open lanes. B) Route 83 will be closed for road...
-
1) A ________ is a file upon which a presentation can be based. A) hyperlink B) template C) watermark D) screenshot 2) Theme names are identified by their ________. A) comments B) layouts C)...
Study smarter with the SolutionInn App