In this exercise, you will modify the program from Lab 9-2 in Chapter 9. If necessary, create
Question:
In this exercise, you will modify the program from Lab 9-2 in Chapter 9. If necessary, create a new project named ModifyThis13 Project, and save it in the Cpp8\Chap10 folder. Copy the instructions from the Lab9-2.cpp file (which is contained in either the Cpp8\Chap09\Lab9-2 Project folder or the Cpp8\Chap09 folder) into a source file named ModifyThis13.cpp. (Alternatively, you can enter the instructions from Figure 9-34 into the ModifyThis13.cpp file.) Change the filename in the first comment to ModifyThis13.cpp. Change the getPayment function to a void function. Test the program appropriately.
Transcribed Image Text:
1 //Lab9-2. cpp - di splays two monthly car payments 2 //Created/revised by
1 //Lab9-2. cpp - di splays two monthly car payments 2 //Created/revised by on 4 #include 5 #include 6 #include 7 using namespace std; 8 9 //function prototype 10 double getPayment (int, double, int);- the names of the formal parameters are not required 11 12 int main() 13 { int carPrice = 0; int rebate - 0; double credi tRate double dealerRate = 0.0; int term = 0; double credi tPayment double dealerPayment = 0.0; 14 15 16 = 0.0; 17 18 19 0.0; %3D 20 %3D 21 cout <« "Car price (after any trade-in): "; cin » carPrice; cout << "Rebate: "; cin >> rebate; cout << "Credit union rate: "; cin >> credi tRate; cout << "Dealer rate: ": cin » dealerRate; cout <« "Term in years: "; cin » term; 22 23 24 25 26 27 28 29 30 31 32 //call function to calculate payments creditPayment = getPayment(carPrice - rebate, creditRate / 12, term * 12); dealerPayment = getPayment(carPrice, dealerRate / 12, term * 12); 33 34 35 36 37 38 //di splay payments cout <« fixed « setprecision (2) « endl; cout << "Credit union payment: S" 39 40 41 42 « credi tPayment « endl; cout << "Dealer payment: S" « dealerPayment <« endl; 43 44 45 return 0; Figure 9-34 Car payment program (continues)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 83% (12 reviews)
ModifyThis13cpp displays two monthly car payments Createdrevised by on include include include using ...View the full answer
Answered By
Jonas Araujo
I have recently received the degree of PhD. In Physics by the Universidade Federal do Maranhão after spending a term in Durham University, as I have been awarded a scholarship from a Brazilian mobility program. During my PhD. I have performed research mainly in Theoretical Physics and published works in distinguished Journals (check my ORCID: https://orcid.org/0000-0002-4324-1184).
During my BSc. I have been awarded a scholarship to study for a year in the University of Evansville, where I have worked in detection-analysis of photon correlations in the the Photonics Laboratory. There I was a tutor in Electromagnetism, Classical Mechanics and Calculus for most of that year (2012).
I am very dedicated, honest and a fast learner, but most of all, I value a job well done.
5.00+
1+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
In this exercise, you will modify the program from Lab 7-2 in Chapter 7. If necessary, create a new project named Intermediate16 Project, and save it in the Cpp8\Chap08 folder. Copy the instructions...
-
In this exercise, you will modify the program that you created in Chapter 6s Lab 6-2. If necessary, create a new project named Intermediate18 Project, and save it in the Cpp8\Chap10 folder. Copy the...
-
In this exercise, you will modify the program that you created in Chapter 6s Lab 6-2. If necessary, create a new project named Intermediate21 Project, and save it in the Cpp8\Chap09 folder. Copy the...
-
An object is placed on the principal axis of a concave mirror of focal length 10 cm at a distance of 80 cm from the pole. Find the position and the nature of the image.
-
Find the center of mass of a bar with mass density p(x) = x2(2 - x) for 0 x 2. Is it to the left or the right of the center of the bar at x = 1 ? Is it at the point where p(x) takes on its maximum?...
-
The circuit in Figure P28.37 has been connected for a long time. (a) What is the voltage across the capacitor? (b) If the battery is disconnected, how long does it take the capacitor to discharge to...
-
7. Gilleo opposed American participation in the war in the Persian Gulf. She displayed a large sign on her front lawn that read, "Say No to War in the Persian Gulf, Call Congress Now." The city of...
-
Weighted-average method. Ashworth Handcraft is a manufacturer of picture frames for large retailers. Every picture frame passes through two departments: the assembly department and the finishing...
-
can you explain how you got the QBI for this problem?. Schedule C OBI Schedule SE Form 4562 P1 Form 4562 P2 Qualified Business Income deduction (QBI) The Qualified Business Income deduction (QBI) is...
-
Initially, Grameen Danone Foods JV was expected to make a profit by 2012. Although no official numbers are published, it seems that they had not reached that point by 2016. Should Danone continue to...
-
In this exercise, you will modify the program from TRY THIS Exercise 11. If necessary, create a new project named ModifyThis12 Project, and save it in the Cpp8\Chap10 folder. Copy the instructions...
-
In this exercise, you will modify the program from Lab10-1. Follow the instructions for starting C++ and viewing the ModifyThis14.cpp file, which is contained in either the Cpp8\Chap10\ModifyThis14...
-
Why must auditors document their understanding of internal control?
-
Describe a recent service breakdown you have experienced. If you do not feel comfortable sharing the name of the business or organization, describe it. For example, you may say " a small doctor's...
-
Write Case diagram for this system, Improving the customer experience Application Website Application Website Customer Service Interface Smart Chat Extra Customer Service System Direct Chat Service...
-
Compare and contrast If you have lived in two cities or countries (or have traveled extensively in them), write a comparison/contrast of life in those two places. Imagine that your audience wishes...
-
Question 4 of 15. Which of these shareholder-employees seems to be receiving reasonable compensation for their full-time position running the S corporation on a daily basis? O Ashlynn is the only...
-
What is positioning within marketing? Compare the importance of positioning in business-to-business markets Provide an example Compare the importance of positioning in consumer markets. Provide an...
-
In Exercises 1-4, find the exact value of the expression, if possible. 1. sin(arcsin 0.3) 2. tan(arctan 45) 3. cos[arccos(3)] 4. sin[arcsin(0.2)]
-
Consider the sections of two circuits illustrated above. Select True or False for all statements.After connecting a and b to a battery, the voltage across R1 always equals the voltage across R2.Rcd...
-
Which of the following calculates the average of the values in the OnHand field? a. SELECT AVERAGE(OnHand) AS Available FROM dbo.Inventory b. SELECT OnHand.AVG AS Available FROM dbo.Inventory c....
-
When used in a parameter query, which of the following WHERE clauses will select the records for employees working more than 40 hours? a. WHERE Hours > @Hours b. WHERE Hours > !Hours c. WHERE Hours >...
-
The SQL SELECT statement performs case-sensitive comparisons. a. True b. False
-
Fundraising is an important aspect of the external activity of many nonprofit CEOs. Group of answer choices True False
-
An airline sells an airline ticket and collects the fare in February for a flight in March to a spring break destination. Based on this information, when would the company recognize revenue? Group of...
-
Payments on behalf of a grandchild made by a grand-parent directly to a medical provider for medical care (the payments of which would be deductible for Federal income tax purposes) Group of answer...
Study smarter with the SolutionInn App