Question

Write C++ program for a compound interest calculator. Ask the user for dep = initial deposit...

Write C++ program for a compound interest calculator.

Ask the user for dep = initial deposit r = interest rate expressed as a fraction (example: .06) t = years If we assume that the money is compounded on a monthly basis, the formula is: double final = dep * pow( 1 + r/12.0 , 12.0*t ); Then display the final amount. To earn full credit, comment your code well.

Supposedly, with a deposit of 1000, and 5% interest (0.05), for 10 years, you wind up with a balance of 1647.01. See if your program equals that! If not, see if you can find a flaw in the expression.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER: Here I am giving you the code and output if you have any problem then comment or like it please.

CODE:

#include<iostream>
#include<math.h>

using namespace std;

int main()
{
   float dep,r,t;
   double final ;
  
   cout<<"Enter initial deposit, interest rate and Time: ";
   cin>>dep>>r>>t;
  
   final =dep*pow( (1 + r/12.0 ), 12.0*t ); // Calculating the compound interest.
  
   cout<<" Compound Interest = "<<final ;

   return 0;
}

OUTPUT:

Add a comment
Know the answer?
Add Answer to:
Write C++ program for a compound interest calculator. Ask the user for dep = initial deposit...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 14.Compound Interest hank account pays compound interest, it pays interest not only on the principal amount...

    14.Compound Interest hank account pays compound interest, it pays interest not only on the principal amount that was deposited into the account, but also on the interest that has accumulated over time. Suppose you want to deposit some money into a savings account, and let the account earn compound interest for a certain number of years. The formula for calculating the balance of the account afer a specified namber of years is The terms in the formula are A is...

  • Python Code, please 2.28 Domain Lab 4.1 -- Simple interest Calculator Simple Interest Calculator Your program...

    Python Code, please 2.28 Domain Lab 4.1 -- Simple interest Calculator Simple Interest Calculator Your program should ask the user (in this order) for: Principal Annual Interest Rate Time Period (years) Your program should then calculate and display: Total Interest Generated Total Future Value

  • in C++ CS121 Lab 6 March 29, 2019 Write a program that will ask the user...

    in C++ CS121 Lab 6 March 29, 2019 Write a program that will ask the user to enter 2 integers, with the first less than the second. If the first is not less that the second, display a message. The program will then check all the integers between the 2 numbers (inclusive) to see if they are divisible by 3, 4, 5, and 6, and if so, display a message It will then ask if they want to go again,...

  • Need in C++ Assignment #1: Write a program to ask the user for a sphere radius...

    Need in C++ Assignment #1: Write a program to ask the user for a sphere radius r as a double. Then compute and display the sphere surface area using S-4*PI'r*r as double. Then compute and display the sphere volume using V-(1.33)*PIr'r*r as double. Use: const double PI-3.14;

  • Your program will ask the user to enter the amount of money they want to borrow,...

    Your program will ask the user to enter the amount of money they want to borrow, the interest rate, and the monthly payment amount. Your program will then determine how many months it will take to pay off that loan, what the final payment amount will be, and how much interest was paid over that time. If the monthly payment amount isn't high enough to pay off more than one month's interest, your program should notify the user what the...

  • c++ and please add tables and everything and make sure program is complete. Write a menu...

    c++ and please add tables and everything and make sure program is complete. Write a menu driven program, which would compute compound interest and a monthly payment for a loan. The user will be given a choice to display the info on the screen or to a filo Menu will be the following Enter (1) to calculate your loan monthly payment Enter (2) to calculate your loan monthly payment & write to a file Tips: Compound Interest Formula A =...

  • I'm trying to write a program that can ask a user about what type of solid...

    I'm trying to write a program that can ask a user about what type of solid they have and to be able to enter values like radius and length of the shape so the program can calculate the volume of a shape and print the result. I also want to give them a repeating option to input another shape if they want to. I'm trying to use at least 7 functions that can display an output, the volumes of a...

  • C++ programming For this assignment, write a program that will act as a geometry calculator. The...

    C++ programming For this assignment, write a program that will act as a geometry calculator. The program will be menu-driven and should continue to execute as long as the user wants to continue. Basic Program Logic The program should start by displaying a menu similar to the following: Geometry Calculator 1. Calculate the area of a circle 2. Calculate the area of a triangle 3. Quit Enter your choice(1-3): and get the user's choice as an integer. After the choice...

  • Create one program using these three programs: 1. Payroll Calculator Need to include state tax amount...

    Create one program using these three programs: 1. Payroll Calculator Need to include state tax amount and SS amount Net pay need to reflect those amount Need to make all the amounts with 2 decimal points. Hint See line #31 - Use the programming outline/format discussed in the lecture, with proper documentation, data declaration, etc. - When asking a user for data, provide user-friendly and clear direction - Same thing for the output. - Include code and screenshot of the...

  • So I have a question in regards to my program. I'm learning to program in C...

    So I have a question in regards to my program. I'm learning to program in C and I was curious about the use of functions. We don't get into them in this class but I wanted to see how they work. Here is my program and I would like to create a function for each of my menu options. I created a function to display and read the menu and the option that is entered, but I would like to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT