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: 78% (14 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?...
-
A script is our conception of the sequence of actions that usually occur during a particular experience. The dentist experiment, in which a participant is asked to remember a paragraph about going to...
-
P 21-7 Enterprise fund statement of cash flows Caleb County had a beginning cash balance in its enterprise fund of $714,525. During the year, the following transactions affecting cash flows occurred:...
-
A mixing process consists of a single stirred-tank instrumented as shown in figure. The concentration of a single species A in the feed stream varies. The controller attempts to compensate for this...
-
HOW DID YOU GET THE 12% FACTOR FIGURES? 6. Capital Budgeting 7 Questions* P13C.4 (Page 636) PROBLEM 13C-4 Basic Net Present Value Analysis Including Income Taxes [L08 Rapid Parcel Service has been...
-
An air-standard Diesel cycle absorbs 1.500 J mol-1 of heat OL Volume
-
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...
-
Red Hot Chili Peppers Co. had the following activity in its most recent year of operations. (a) Purchase of equipment. (b) Redemption of bonds payable. (c) Sale of building. (d) Depreciation. (e)...
-
State the vertical asymptotes, if any exist for the function. T f(x) = x+81
-
4. Oh no! Prof. Conlin was doing the dishes, but ran out of space on his drying rack. He decided to set the last two bowls on a towel on the counter to dry. He wondered, "To make sure they get dry,...
-
It has been assumed so far that the firm will operate a project over its full physical life. However, may not be the best option - it may be better to abandon a project prior to the end of potential...
-
33-34 Find (a) f + g, (b) f- g, (c) fg, and (d) f/g and state their domains. 33. f(x)=25-x, g(x) = x+1 ===== 1 34. f(x)= x-1' 9(x)=-2 X
-
Describe five steps independent auditors take when auditing an organization. -An independent auditor, often a public accounting firm, begins an audit by studying the business. This approach helps to...
-
Here are the comparative condensed income statements of Delaney Corporation. Instructions a. Prepare a horizontal analysis of the income statement data for Delaney Corporation, using 2021 as a base....
-
(8%) Problem 6: A student attaches a f= 3.5 kHz oscillator to one end of a metal rail of length L = 25 m. The student turns on the oscillator and uses a piezoelectric gauge at the other end to...
-
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
-
Berbice Inc. has a new project, and you were recruitment to perform their sensitivity analysis based on the estimates of done by their engineering department (there are no taxes): Pessimistic Most...
-
#3) Seven years ago, Crane Corporation issued 20-year bonds that had a $1,000 face value, paid interest annually, and had a coupon rate of 8 percent. If the market rate of interest is 4.0 percent...
-
I have a portfolio of two stocks. The weights are 60% and 40% respectively, the volatilities are both 20%, while the correlation of returns is 100%. The volatility of my portfolio is A. 4% B. 14.4%...
Study smarter with the SolutionInn App