Diese Präsentation wurde erfolgreich gemeldet.

# Write a C++ program that reads in investment amount- annual interest r.docx

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige  ×

1 von 2 Anzeige

# Write a C++ program that reads in investment amount- annual interest r.docx

Write a C++ program that reads in investment amount, annual interest rate, and number of years in this order, and displays the future investment value using the following formula:
accumulated value = investmentAmount x (1 + monthlyInterestRate)numberOfYears*12
Solution
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
double investment_amount;
double interest_rate;
int number_of_years;
cout <<\"Enter investment Amount :\";
cin >>investment_amount;
cout << endl;
cout <<\"Enter Interest :\";
cin >>interest_rate;
cout << endl;
cout <<\"Enter number of years :\";
cin >>number_of_years;
cout << endl;
//accumulated value = investmentAmount x (1 + monthlyInterestRate)numberOfYears*12
double av = investment_amount*pow((1+interest_rate/1200),number_of_years*12);
cout <<\"Future Value Given by :\" << av << endl;
system(\"pause\");
return 0;
}
.

Write a C++ program that reads in investment amount, annual interest rate, and number of years in this order, and displays the future investment value using the following formula:
accumulated value = investmentAmount x (1 + monthlyInterestRate)numberOfYears*12
Solution
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
double investment_amount;
double interest_rate;
int number_of_years;
cout <<\"Enter investment Amount :\";
cin >>investment_amount;
cout << endl;
cout <<\"Enter Interest :\";
cin >>interest_rate;
cout << endl;
cout <<\"Enter number of years :\";
cin >>number_of_years;
cout << endl;
//accumulated value = investmentAmount x (1 + monthlyInterestRate)numberOfYears*12
double av = investment_amount*pow((1+interest_rate/1200),number_of_years*12);
cout <<\"Future Value Given by :\" << av << endl;
system(\"pause\");
return 0;
}
.

Anzeige
Anzeige

### Write a C++ program that reads in investment amount- annual interest r.docx

1. 1. Write a C++ program that reads in investment amount, annual interest rate, and number of years in this order, and displays the future investment value using the following formula: accumulated value = investmentAmount x (1 + monthlyInterestRate)numberOfYears*12 Solution #include<iostream> #include<cmath> using namespace std; int main() { double investment_amount; double interest_rate; int number_of_years; cout <<"Enter investment Amount :"; cin >>investment_amount; cout << endl; cout <<"Enter Interest :"; cin >>interest_rate; cout << endl; cout <<"Enter number of years :"; cin >>number_of_years; cout << endl; //accumulated value = investmentAmount x (1 + monthlyInterestRate)numberOfYears*12 double av = investment_amount*pow((1+interest_rate/1200),number_of_years*12); cout <<"Future Value Given by :" << av << endl; system("pause"); return 0; }