Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

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

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Nächste SlideShare
4_5906613426901224666.docx
4_5906613426901224666.docx
Wird geladen in …3
×

Hier ansehen

1 von 2 Anzeige

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

Herunterladen, um offline zu lesen

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

Weitere Verwandte Inhalte

Ähnlich wie Write a C++ program that reads in investment amount- annual interest r.docx (20)

Weitere von lez31palka (20)

Anzeige

Aktuellste (20)

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; }

×