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: 64% (17 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...
-
Three charges of equal magnitude q are fixed in position at the vertices of an equilateral triangle (Fig. P23.64). A fourth charge Q is free to move along the positive x axis under the influence of...
-
Go to the AICPA's Antifraud Resource Center and search for forensic accounting topics. Read some of the material listed. Search for material dealing with litigation support. What type of forensic...
-
Freeze Refrigerator Company purchases ice makers and installs them in its products. The ice makers cost $138 per case, and each case contains 12 ice makers. The supplier recently gave notice that the...
-
Answer this question please?. Question 11 (10 points) Perpetual Method Journal Entries (10 marks) ABC Co. deals in a variety of low-priced merchandise and uses the Perpetual Inventory method. Prepare...
-
Findlay Instruments produces a complete line of medical instruments used by plastic surgeons and has experienced rapid growth over the past 5 years. In an effort to make more accurate predictions of...
-
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...
-
A degree-day is a unit used to measure the fuel requirements of buildings. By definition, each degree that the average daily temperature is below 65F is 1 degree-day. For example, an average daily...
-
How do you implement advanced cryptographic techniques, such as homomorphic encryption or zero-knowledge proofs, to ensure the verifiability and authenticity of data, thereby maintaining data...
-
How do you address the challenges associated with data provenance and lineage tracking in ensuring end-to-end integrity across complex data workflows, including the implementation of metadata...
-
How does the Data Definition Language (DDL) facilitate the creation, modification, and removal of database objects, enforcing structural integrity and ensuring data consistency within a relational...
-
How does normalization facilitate the process of structuring relational databases to conform to higher normal forms, thereby enhancing data consistency and reducing the likelihood of anomalies such...
-
How do you merge two sorted arrays into one sorted array? def merge_sorted_arrays(arr1, arr2): # Your code here pass
-
The base of the triangle shown in the figure is also the radius of a circular arc. (a) Find the area A of the shaded region as a function of θ for 0 (b) Use a graphing utility to graph...
-
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
-
ID_T1_Q1: How many women are aged 20-29 (rounding errors may apply)?? 87,000 1,972,000 1,047,000 928,000 ID_T1_Q2: Which age group has the largest gender disparity? 5-9 25-29 40-44 65+ ID_T1_Q3:...
-
A business owner of a specialty foods store does a full review of the inventory on hand and discovers items that have perished. What is the accounting journal entry that should be made to adjust the...
-
630 CHAPTER 10 DISTRIBUTED SYSTEMS 10.13 Derive the temporal frequency equation for longitudinal vibration of the system shown in Figure P10.13. ad bloods k die nominas to nohom to moitsupo svmod.1...
Study smarter with the SolutionInn App