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 normalized load on a lossless transmission line is 2 + j 1. Let = 20 m and make use of the Smith chart to find (a) The shortest distance from the load to a point at which z in = r in + j0, where...
-
According to the Congressional Research Service, 2,191,011 people are employed by the federal government in the United States. Suppose that a random sample of 3,500 of these federal employees was...
-
Liquid Chemical, Ltd. sells a range of high- grade chemical products throughout the Pacific North-west from its main plant in Vancouver, British Columbia. The companys products, because of their...
-
Tamarisco A partir del 1 de enero de 2025, Industries tena una patente registrada en sus libros. Esta patente tena un valor contable de 480.000 dlares y una vida til restante de 8 aos. Durante 2025,...
-
Use the following information to prepare a 2021 Form 1040, Schedule 1, and Schedules A and B for Leonard Cox. 1. Leonard Cox is a single taxpayer. Leonards social security number is 445-01- 9266, 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...
-
On January 1, 2011, Franklin Industries leased equipment on an eight-year term at $15,000 annual rental payments, paid in advance. There is a bargain purchase option on December 31, 2018 (end of...
-
After graduating from college in May 2018, Ryan Crews started his career in finance at the W&T Corporation, a small- to medium-sized warehouse distributor in Nashville, Tennessee. The company was...
-
What an example STAR (Situation, Task, Action, Result.) question for a Accounting example on how there was a time when you had a disagreement with someone. As for context use a excel project?
-
Find a trade (amount of wine exchanged for amount cheese) that makes both countries better off in both goods relative to when no trade was allowed. What is the consumption point in each country with...
-
Describe the five P's in detail (product, price, place, promotion, and people for Panera Bread.
-
Carol charged her credit card 10,000 dollars on December 31, 2011. The monthly interest rate charged by the credit card company is 1% of the unpaid balance at the end of each month. Carol wishes to...
-
Ropeonfire is currently deciding on the level and form of its next dividend. It is considering three options: (i) A cash dividend payment of 20p per share; (ii) A 6 per cent scrip dividend; (iii) A...
-
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
-
Solve these equations Sy = b with 81, 82, 83 in the columns of S: 0 0 10 Y2 100 0 1998-8-1988-8 and S is a sum matrix. The sum of the first 5 odd numbers is ][
-
Active Life Ltd has decided to manufacture a new line of running shoes based on a $50,000, two-year feasibility study. The shoes will sell for $85 a pair and has a variable cost of $30 a pair. It is...
-
Arch Airway expects to purchase 5.6 million gallons of jet fuel in three months and decides to use heating oil futures to hedge the fuel price risk. A regression has been performed: The dependent...
Study smarter with the SolutionInn App