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?...
-
At the beginning of the year four years ago, Mountain View Company purchased construction equipment for $912,600, with a useful life of eight years and estimated salvage value of $99,000. The company...
-
Prove that \(B(x ; n, p)=1-B(n-x-1 ; n, 1-p)\).
-
Suresh Co. expects its five departments to yield the following income for next year. Recompute and prepare the departmental income statements (including a combined total column) for the company under...
-
The balance sheet for Trinity Motors Company for December 3 1 of 2 0 2 2 and 2 0 2 3 . What was the cash flow to stockholders in 2 0 2 3 ?
-
Schultzs change initiative might succeed at another company that values customization and high levels of customer service, but how would it need to differ at a firm that emphasizes speed and...
-
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...
-
A nonlinear spring has a restoring force which is proportional to the cube of the displacement x. The period T of oscillation from an initial displacement a is given by Use the substitution x 2 = a 2...
-
Gabriela plans to invest $1,500 at the end of each quarter for 5 years into an account with an APR of 6.3 percent compounded quarterly. She will use this money as a down payment on a new home at the...
-
Hoong Du has a \($6,400\) debt balance on his American Express card that charges an APR of 12.6 percent compounded monthly. Hoongs current minimum monthly payment is 4 percent of his debt balance, or...
-
a. Calculate the future sum of $6,500, given that it will be held in a Swiss bank for 5 years at an annual interest rate of 7 percent. b. Recalculate part(a) assuming the interest rates is (1) an APR...
-
What is the present value of the following? a. A $350 perpetuity discounted back to the present at 7 percent b. A $1,240 perpetuity discounted back to the present at 11 percent c. A $150 perpetuity...
-
Assume the New Zealand Powerballs milliondollar payout provides for NZ\($2\) million to be paid over 19 years in 20 payments of NZ\($100,000\) each. The first NZ\($100,000\) payment is made...
-
A beam of light is sent directly down onto a glass plate (n = 1.5) and a plastic plate (n = 1.2) that form a thin wedge of air (see the drawing). An observer looking down through the glass plate sees...
-
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
-
Simplify. 2 x-4)2x +0x - 26x - 24
-
On January 1 , 2 0 X 2 P pays $ 1 0 0 million to acquire 5 0 , 0 0 0 of the common voting shares of S , which gives P a 2 5 % ownership interest in S . The January 1 , 2 0 X 2 book value of S ' s...
-
Shaw Company has the following account balances: Receivables $ 1 0 0 , 0 0 0 Inventory 1 5 0 , 0 0 0 Land 1 0 0 , 0 0 0 Building net 2 5 0 , 0 0 0 Liabilities 1 0 0 , 0 0 0 Common stock 1 0 0 , 0 0 0...
Study smarter with the SolutionInn App