Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
9th Edition
ISBN: 9780134498379
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 3, Problem 18PC

Interest Earned

Assuming there are no deposits other than the original investment, the balance in a savings account after one year may be calculated as

Amount = Principle ×  ( 1 +  Rate T ) T

Principal is the balance in the savings account, Rate is the interest rate, and T is the number of times the interest is compounded during a year (T is 4 if the interest is compounded quarterly).

Write a program that asks for the principal, the interest rate, and the number of times the interest is compounded. It should display a report similar to:

Interest Rate: 4.25%
Times Compounded: 12
Principal: $1000.00
Interest: $43.34
Amount in Savings: $1043.34
Blurred answer
Students have asked these similar questions
Write a program that can calculate the future and present value of an investment given various parameters. When you calculate the future value of an investment, the more years you hold the investment and the higher the rate of return, the more valuable it is. For example, a $1000 investment at 7% return will give you $1070 (1000+ 0.07-1000) after one year and $1144.90 (1070+0.07-1007) after two years. However, because of inflation, that $1144.90 after two years is not worth the same as $1144.90 now. If the inflation rate is 2%, $1144.90 in two years is the equivalent of $1100.44 now-i.e- 102 More generally, the present value, p, of an investment is 1.02² 1144.90 f p= where is the inflation rate as a percentage. Typically, one would add to the investment with annual contributions. Let's say you start with a $1000 investment and add $100 every year. Therefore, after the first year, you will have $1177 - 7% return on $1100i.e. $1000 initial investment + the $100 year one contribution.…
Running the program Your program should take 5 arguments: start annual years return inflation where start is the initial investment amount annual is the amount that is added to the investment every year years is the number of years that the investment is held return is the annual investment return expressed as a percentage inflation is the annual inflation rate expressed as a percentage So, to calculate the future and present value of $1000 investment after 10 years where you add $100 every year with a 7% return and 2% inflation, you give the following arguments and get this output: $ ./fv 1000 100 10 7 2 Future Value: $3445.51 Present Value: $2826.52 Writing the code Starter code is provided for you below int main(int arge, char **argv ) { int a, n double value, present, I, is value= atof (argv[1]); a = atoi (argv[2]); natoi (argv[3]); r = atof (argv[4])/100; i = atof(argv[5])/100; // TODO write your code here printf ("Future Value: $%.2f\n", value) printf("Present Value: $%.2f\n",…
PROGRAM DESCRIPTION John dela Cruz is interested in knowing how much his interest earning would be after some time. Assuming there are no deposits other than the original investment, the balance in a savings account after one year may be calculated as: amount = principal * (1 + rate/m)" interest = amount - principal Principal is the balance in the savings account, rate is the interest rate (0 to 100), m is the number of times the interest is compounded during a year (m is either 1,2,3 or 4 if the interest is compounded quarterly) and nis the number of year., Write a program that asks for the borrower's lastname, borrower's first name, borrower's middle name, civil status (Single, Married, Widow), principal, the interest rate and the number of times the interest is compounded. Follow the format of the report provided in the example. OUTPUT Example 1 Enter the borrower's lastname : Enter the borrower's firstname : Enter the borrower's middle name: Enter civil status : Married Enter the…

Chapter 3 Solutions

Starting Out with C++ from Control Structures to Objects (9th Edition)

Ch. 3.5 - Assume the following variable definitions: int a =...Ch. 3.5 - Complete the following program skeleton so it asks...Ch. 3.5 - Prob. 3.13CPCh. 3.6 - Write a multiple assignment statement that assigns...Ch. 3.6 - Write statements using combined assignment...Ch. 3.6 - Prob. 3.16CPCh. 3.7 - Write cout statements with stream manipulators...Ch. 3.7 - Prob. 3.18CPCh. 3.7 - The following program skeleton asks for an angle...Ch. 3.9 - Prob. 3.20CPCh. 3.9 - Assume the variables angle1 and angle2 hold angles...Ch. 3.9 - To find the cube root (the third root) of a...Ch. 3.9 - The cosecant of the angle a is 1sina Write a...Ch. 3 - Assume the following variables are defined: int...Ch. 3 - Prob. 2RQECh. 3 - Prob. 3RQECh. 3 - Complete the following table by determining the...Ch. 3 - Write C++ expressions for the following algebraic...Ch. 3 - Assume a program has the following variable...Ch. 3 - Assume a program has the following variable...Ch. 3 - Assume qty and salesReps are both integers. Use a...Ch. 3 - Rewrite the following variable definition so that...Ch. 3 - Complete the following table by providing...Ch. 3 - Write a multiple assignment statement that can be...Ch. 3 - Write a cout statement so the variable divSales is...Ch. 3 - Write a cout statement so the variable totalAge is...Ch. 3 - Prob. 14RQECh. 3 - The__________ library function returns the cosine...Ch. 3 - The ___________ library function returns the sine...Ch. 3 - The ________ library function returns the tangent...Ch. 3 - The __________ library function returns the...Ch. 3 - The _________ library functionreturns the...Ch. 3 - The _________ library function returns the natural...Ch. 3 - Prob. 21RQECh. 3 - The _______ library function returns the value of...Ch. 3 - The _________ libraryfunction returns the square...Ch. 3 - The ________ file must beincluded in aprogramthat...Ch. 3 - A retail store grants its customers a maximum...Ch. 3 - Write a pseudocode algorithm for a program that...Ch. 3 - Write a pseudocode algorithm for a program that...Ch. 3 - using namespace std; int main () { double number1,...Ch. 3 - #include iostream using namespace std; int main()...Ch. 3 - #include iostream; using namespace std; int main()...Ch. 3 - #include iostream; using namespace std; main { int...Ch. 3 - #inc1ude iostream; using namespace std; main {...Ch. 3 - #inc1ude iostream; using namespace std; int main()...Ch. 3 - What will each of the following programs display?...Ch. 3 - #include iostream using namespace std; int main()...Ch. 3 - (Assume the user enters George Washington.)...Ch. 3 - (Assume the user enters 36720152. Use a...Ch. 3 - Miles per Gallon Write a program that calculates a...Ch. 3 - Stadium Seating There are three seating categories...Ch. 3 - Test Average Write a program that asks for five...Ch. 3 - Average Rainfall Write a program that calculates...Ch. 3 - Male and Female Percentages Write a program that...Ch. 3 - Ingredient Adjuster A cookie recipe calls for the...Ch. 3 - Box Office A movie theater only keeps a percentage...Ch. 3 - How Many Widgets? The Yukon Widget Company...Ch. 3 - How Many Calories? A bag of cookies holds 30...Ch. 3 - How Much Insurance? Many financial experts advise...Ch. 3 - Automobile Costs Write a program that asks the...Ch. 3 - Celsius to Fahrenheit Write a program that...Ch. 3 - Currency Write a program that will convert U.S....Ch. 3 - Monthly Sales Tax A retail company must file a...Ch. 3 - Property Tax A county collects property taxes on...Ch. 3 - Senior Citizen Property Tax Madison County...Ch. 3 - Math Tutor Write a program that can be used as a...Ch. 3 - Interest Earned Assuming there are no deposits...Ch. 3 - Monthly Payments The monthly payment on a loan may...Ch. 3 - Pizza Pi Joes Pizza Palace needs a program to...Ch. 3 - How Many Pizzas? Modify the program you wrote in...Ch. 3 - Angle Calculator Write a program that asks the...Ch. 3 - Stock Transaction Program Last month Joe purchased...Ch. 3 - Planting Grapevines A vineyard owner is planting...Ch. 3 - Word Game Write a program that plays a word game...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY