In this exercise, you will modify the program from Lab 5-1. If necessary, create a new project
Question:
In this exercise, you will modify the program from Lab 5-1. If necessary, create a new project named ModifyThis10 Project, and save it in the Cpp8\Chap05 folder. Enter the instructions shown earlier in Figure 5-23 into a new source file named ModifyThis10.cpp. Currently, the 20% rate is assigned to the rate variable only when the code variable contains either the character 1 or the character 3. Modify the selection structure so that codes 1 and 3 still get the 20% rate, but only when the sales amount is at least $20,000; otherwise, they should get the 15% rate. Test the program appropriately.
Figure 5-23
Transcribed Image Text:
1 //Lab5-1.cpp - displays projected sales 2 //Created/revi sed by
1 //Lab5-1.cpp - displays projected sales 2 //Created/revi sed by on 4 #include 5 #include 6 using namespace std; 7 8 int main() 9 { 10 double sales 0.0; double rate - 0.0; = ' '; 11 12 char code 13 cout << "Sales: "; cin >> sales; cout << "Code (1, 2, 3, or 4): "; cin >> code; 14 15 16 17 18 if (code == '1' || code 0.2; 19 '3') 20 21 rate = else 22 rate = 0.15; //end if %3D 23 24 //calculate and di splay the projected sales amount sales = sales + sales * rate; cout <« fixed « setprecision (2); cout <« "Projected sales: " <« sales « endl; 25 26 27 28 29 30 return 0; 31 } //end of main function
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 66% (18 reviews)
ModifyThis10cpp displays projected sales Createdrevised by on include include using namespace std ...View the full answer
Answered By
JAPHETH KOGEI
Hi there. I'm here to assist you to score the highest marks on your assignments and homework. My areas of specialisation are:
Auditing, Financial Accounting, Macroeconomics, Monetary-economics, Business-administration, Advanced-accounting, Corporate Finance, Professional-accounting-ethics, Corporate governance, Financial-risk-analysis, Financial-budgeting, Corporate-social-responsibility, Statistics, Business management, logic, Critical thinking,
So, I look forward to helping you solve your academic problem.
I enjoy teaching and tutoring university and high school students. During my free time, I also read books on motivation, leadership, comedy, emotional intelligence, critical thinking, nature, human nature, innovation, persuasion, performance, negotiations, goals, power, time management, wealth, debates, sales, and finance. Additionally, I am a panellist on an FM radio program on Sunday mornings where we discuss current affairs.
I travel three times a year either to the USA, Europe and around Africa.
As a university student in the USA, I enjoyed interacting with people from different cultures and ethnic groups. Together with friends, we travelled widely in the USA and in Europe (UK, France, Denmark, Germany, Turkey, etc).
So, I look forward to tutoring you. I believe that it will be exciting to meet them.
3.00+
2+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
In this exercise, you modify the highest number program from the chapter. If necessary, create a new project named ModifyThis20 Project and save it in the Cpp8\Chap11 folder. Enter the C++...
-
In this exercise, you will modify the program from Computer Exercise 12. If necessary, create a new project named ModifyThis14 Project, and save it in the Cpp8\Chap09 folder. Enter (or copy) the...
-
In this exercise, you modify the pizza slices program shown in Figure 15-10 in the chapter. If necessary, create a new project named ModifyThis10 Project and save it in the Cpp8\Chap15 folder. Enter...
-
An arm ABC lying in a horizontal plane and supported at A (see figure) is made of two identical solid steel bars AB and BC welded together at a right angle. Each bar is 20 in. long. Knowing that the...
-
The p.d.f. of a random variable T is g(t) = 6t(1 - t) for 0 t 1 Find the probability that the random variable has a value less than one standard deviation below the expectation and less than two...
-
Describe how experiments using the following physiological techniques have provided evidence of parallels between imagery and perception: (a) brain imaging; (b) deactivation of part of the brain; (c)...
-
1 Expatriate managers need to take account of the cultural realities. Which cultural realities did the expatriate manager fail to take account of? How should he have dealt with the cultural realities?
-
What principle(s) from the conceptual framework does Hen day Limited use in each of the following situations? (a) Henday includes the activities of its subsidiaries in its financial statements. (b)...
-
Break-Even Sales and Sales Mix for a Service Company Zero Turbulence Airline provides air transportation services between Los Angeles, California, and Kona, Hawaii. A single Los Angeles to Kona...
-
Some people might recall being told to be sure to put on a hat when outside in cold weather because "you lose all the heat out the top of your head." Comment on the validity of this statement.
-
Complete Figure 5-34 by writing the algorithm and corresponding C++ instructions. Employees with a pay code of 1, 4, or 9 receive a 4.5% raise; all other employees receive a 3.5% raise. If necessary,...
-
A third-grade teacher at Potter Elementary School wants a program that allows a student to enter the amount of money a customer owes and the amount of money the customer paid. The program should...
-
The article discussed in the previous exercise also describes an experiment in which 35 students were asked to price two boxes of silverware: a 24-piece box with all 24 pieces intact, and a 40-piece...
-
Skinovations needs to put together a Production schedule for next week and has asked its marketing team to give its forecasts for next week's sales. The team has used two different forecasting...
-
If a potential leader viewed her least preferred co-worker in favorable terms, how would Fiedler's Model describes this leader?
-
You have just been hired as a financial analyst for Lydex Company, a manufacturer of safety helmets. Your boss has asked you to perform a comprehensive analysis of the company s financial statements,...
-
For our first discussion you should locate a research article in which a quantitative study is reported. This article should not be a theoretical article or a methods article, but should describe...
-
A box is separated by a partition which divides its volume in the ration of 3:1. the larger portion of the box contains 1000 molecules of Ne gas; the smalled portion contains 100 molecules of He gas....
-
What types of accounts does a company increase or decrease in a prepaid expense adjustment?
-
D Which of the following is considered part of the Controlling activity of managerial accounting? O Choosing to purchase raw materials from one supplier versus another O Choosing the allocation base...
-
If the decPay variable contains the number 1200.76, which of the following statements displays the number as 1,200.76? a. lblPay.Text = decPay.ToString("N2") b. lblPay.Text = decPay.ToString("F2") c....
-
Which of the following statements declares a procedure-level variable that is removed from the computers memory when the procedure ends? a. Const intCounter As Integer b. Dim intCounter As Integer c....
-
Most of the memory locations declared in an application should be class-level variables. a. True b. False
-
crane Inc. common chairs currently sell for $30 each. The firms management believes that it's share should really sell for $54 each. If the firm just paid an annual dividend of two dollars per share...
-
Determine the simple interest earned on $10,000 after 10 years if the APR is 15%
-
give me an example of 10 transactions from daily routine that we buy and put for me Liabilities + Owners' Equity + Revenues - Expenses
Study smarter with the SolutionInn App