Financial application c++ program

(Financial application: compound value) Suppose you save $100 each month into a 
savings account with the annual interest rate 5%. Thus, the monthly interest rate is 
0.05/12 = 0.00417. After the first month, the value in the account becomes
100 * (1 + 0.00417) = 100.417 
 After the second month, the value in the account becomes
(100 + 100.417) * (1 + 0.00417) = 201.252 
 After the third month, the value in the account becomes
(100 + 201.252) * (1 + 0.00417) = 302.507 
 and so on.
 Write a program that prompts the user to enter a monthly saving amount and displays 
the account value after the sixth month
#Beginner
In gcc c++ compiler using namespace std;


#include<iostream>
using namespace std;

int main()
{
float amount,total=0;
cout<<"Enter te monthly saving amount $ :";
cin>>amount;
total=amount*(1+0.00417);//1st
total=(amount+total)*(1+0.00417);//2nd
total=(amount+total)*(1+0.00417);//3rd
total=(amount+total)*(1+0.00417);//4th
total=(amount+total)*(1+0.00417);//5th
total=(amount+total)*(1+0.00417);//6th
cout<<"After the sixth month,te account value is $"<<total;
return 0;
}
copy


Output
Enter te monthly saving amount $ :100
After the sixth month,te account value is $608.818
[Program finished]

Need of Programmer

Need of Programmer

Comments

Popular posts from this blog

Write a program that reads in the radius and length of a cylinder and computes the area and volume using the following formulas: area = radius * radius * π volume = area * length

Write a program that prompts the user to enter two points (x1, y1) and (x2, y2) and displays their distance between them.The formula for computing the distance is

Area and perimeter of an equilateral triangle c++ program