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: 66% (12 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...
-
The kind of organization in which larger, more general categories are divided into smaller, more specific categories is called hierarchical organization. L01
-
4. The simplified accounting equation for proprietary funds is: a Current assets Noncurrent assets All liabilities Fund balance b Current assets Noncurrent assets All liabilities Net position c...
-
The investments of Macon, Inc., include a single investment: 8,000 shares of Pacific Wave, Inc. common stock purchased on August 10, 2012, for $8 per share including brokerage commission. These...
-
Hello. Please help answer in 1.5 hours. I will promise to give good rating. Please double check answer. Thanks so much QUESTION 2 (14 marks) Gordon Company uses a periodic inventory system and the...
-
Ms. Mary Kelley has initial wealth W0 = $1,200 and faces an uncertain future that she partitions into two states, s = 1 and s = 2. She can invest in two securities, j and k, with initial prices of pj...
-
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...
-
The following costs were incurred for the month of June for the Process A23 Department. Use this information to prepare a responsibility report for the month of June. Budget Actual Sales in units.....
-
The following information about the payroll for the week ended December 30 was obtained from the records of Saine Co.: Salaries: Sales salaries Deductions: $180,000 Income tax withheld $65,296...
-
You have just been hired as the chief executive officer (CEO) in a medium-sized organization. The organization is not suffering financially, but neither is it doing as well as it could do. This is...
-
The following is the selling price and cost information about three joint products: X Y Z Anticipated production 1 2 , 0 0 0 lbs . 8 , 0 0 0 lbs . 7 , 0 0 0 lbs . Selling price / lb . at split - off...
-
calculate the maximum bending compressive stress of the following section under NEGATIVE bending moment of 216KN.m. 216mm 416mm 316mm 115mm
-
Need assistance with the following forms: 1040 Schedule 1 Schedule 2 Schedule C Schedule SE Form 4562 Form 8995 Appendix B, CP B-3 Christian Everland (SS number 412-34-5670) is single and resides at...
-
The following is information for Lieu Co. for the month of January 2022. Instructions Prepare an income statement using the format presented in Illustration 6.4. Prepare a multiple-step income...
-
Review Exhibit 11.4. Analyze each product on the graph according to the characteristics that influence the rate of adoption. For example, what can you conclude from the data about the relative...
-
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....
-
3. The nominal interest rate compounded monthly when your $7,000 becomes $11,700 in eight years is ________
-
An investor can design a risky portfolio based on two stocks, A and B. Stock A has an expected return of 21% and a standard deviation of return of 39%. Stock B has an expected return of 14% and a...
-
Advanced Small Business Certifica Drag and Drop the highlighted items into the correct boxes depending on whether they increase or decrease Alex's stock basis. Note your answers- you'll need them for...
Study smarter with the SolutionInn App