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: 70% (10 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...
-
2. Complete the sentence: "cGMP is that part of the Quality Assurance System which ensures that products are manufactured consistently to a quality"... b) "that suits the needs of the manufacturer"...
-
An airplane is flying at a flight (or local) Mach number of 0.70 at \(10,000 \mathrm{~m}\) in the Standard Atmosphere. Find the ground speed (a) if the air is not moving relative to the ground (b) if...
-
Montoure Company uses a periodic inventory system. It entered into the following calendar-year 2016 purchases and sales transactions. (For specific identification, units sold consist of 600 units...
-
Financial markets are not responsible for government over-borrowing, any more than your bank forces you to take out a car loan unless you want to. It is nevertheless true that investment banks will...
-
Consider the balance sheets and selected data from the income statement of Keith Corporation that appear below and on shown below. Keith Corporation Income Statement Data (2012) Depreciation expense...
-
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...
-
Name three rights of common stockholders. Which of these is most important in your opinion? Why?
-
Write down an equation representing the liquidity premium theory of the term structure of interest rates. Based on this theory, explain how the yields on short-term and medium-term government bonds...
-
You work with organizations to provide hospitality solutions which help business build stronger relationships with their employees and customers. You will represent the TAMPA BAY BUCCANEERS. Your...
-
In this project, you will demonstrate your mastery of the following competency: Describe the purpose and function of financial management in an organization Scenario You've been an entry-level...
-
e. On January 1, 2017, P acquired 80% of S for $400,000. On the date of acquisition, S had the following balance sheet: S Company Balance Sheet January 1, 2017 Assets Liabilities and Stockholders'...
-
Using both manual calculations and Moffcalc, calculate the monthly payment for a $416,000 loan. The loan is for 15 years. The Nominal Annual Interest Rate is 11.39%. What is the Effective Interest...
-
Three reputed cell phone companies are offering for $399 + a 2-year contract, the phone you wish to buy. However, for the same number of minutes and other features (e.g., number of text messages),...
-
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....
-
3. Given the following circuit... A B C a. Analyze the behavior of the above circuit with a truth table. Create a column for every gate excluding NOT gates. b. What is the equivalent Boolean...
-
A baker finds several new recipes to try. Of the new recipes, there are 11 for cookies, 10 for muffins, and 4 for cakes. If the baker selects a recipe at random, what is the probability the recipe is...
-
- Sketch a graph of the polynomial function defined by y = -2(x + 1)(x 2). 6 -2.5 -2 -15 -1 -0.5 0,5 15 { 25 -6 -8
Study smarter with the SolutionInn App