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 reads the subtotal and the gratuity rate, then computes the gratuity and total. For example, if the user enters 10 for subtotal and 15% for gratuity rate, the program displays $1.5 as gratuity and $11.5 as total.

Write a program that prompts the user to enter the min- utes (e.g., 1 billion), and displays the number of years and days for the minutes. For simplicity, assume a year has 365 days