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: 62% (16 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...
-
Should multinational firms dictate debt ratio limits and dividend payouts to their foreign affiliates?
-
The static pressure to stagnation pressure ratio at a point in a gas flow field is measured with a Pitot-static probe as being equal to 0.6 . The stagnation temperature of the gas is \(20^{\circ}...
-
Accounting for Pollution Expenditure Counting Crows Company operates several plants at which limestone is processed into quicklime and hydrated lime. The Eagle Ridge plant, where most of the...
-
An object is thrown upward with an initial velocity of 20m/s from the edge of a cliff of unknown height this object lands on the base after 8.3s 1 Determine height of the cliff 2 position of the...
-
Why is the timing of the Services Acquisition process so critical for effective, affordable services acquisition, and what is the impact of the necessary actions being delayed, deferred, or omitted?...
-
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...
-
Biochemists studying the structure of collagen (a fibrous protein in connective tissue) found cross-links containing ,-unsaturated aldehydes between protein chains. Show the structures of the side...
-
What is risk and to what extent can it be diversified away when making investment decisions? Explain why the standard deviation may be useful in measuring risk. What are share warrants and what are...
-
What is the most critical phase in the detailed decision making process? What is the term for when software is installed on a computer without authorization and encrypts files and demands payments in...
-
Do you understand the significant uncertainties, or soft spots, inherent in the organization's strategies for achieving its business objectives and performance goals?
-
Aztec Industries produces bread which goes through two operations, Mixing and Baking, before it is ready to be packaged. Next year's expecte activities are shown below. Mixing 414,000 DLH Baking...
-
If the company engages in significant trading activities or uses derivatives in a significant way, is the financial and risk management strategy clear?
-
Scott Andrew owns and operates a car-detailing business named "Super Shine & Detailing." For $150, Scott's business will hand wash and wax customers' cars, vacuum the interior, and thoroughly clean...
-
The landing gear of an aircraft with: mass of 2000 kg the spring-mass-damper system Consider that the runway surface is y(t) = 0.2 cos 157.08t stiffness of the spring is 5 x 105 N/m. What is the...
-
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
-
Thanasi has a business snowplowing. He uses a 2018 Ford Rapture with a snowplow outfitted to it. While plowing a driveway, he negligently ran it into the side of the neighbour's house. The damage to...
-
Mary was so excited about the holiday shopping season that she could hardly wait for the Black Friday sales. She got up early and spent all day at her favorite store, Mega Deals, shopping. Mary was...
-
This can be done as a group or individually. If done in a group, all group members must submit a copy of this assignment to receive a grade. If you were to open a business, what type of business...
Study smarter with the SolutionInn App