I'm taking a beginning programming class. I got the program to do what was asked, but I had to muss up the cout lines to get the output to display uniformly. Is there something I missed that can clean up my code? Thanks in advance for your time.
#include
#include
#include
using namespace std;
int main()
{
double interest_rate;
double principle;
double interest;
double acc_tot;
int comp;
cout << "Please enter principle Savings Account deposit:" << endl;
cin >> principle;
cout << "Please enter applicable Interest Rate Percentage in decimal form:" << endl;
cin >> interest_rate;
cout << "Please enter number of Fiscal Quarters to be compounded;" << endl;
cin >> comp;
acc_tot = principle * pow(1 + (interest_rate / comp), comp);
interest = acc_tot - principle;
interest_rate=interest_rate*100;
cout << "Interest Rate:" << setw(17) << interest_rate << "%" << fixed << setprecision(2) << endl;
cout << "Quaters Compunded:" << setw(14) << comp << endl;
cout << "Priciple:" << setw(16) << "$" << principle << endl;
cout << "Interest Earned:" << setw(11) << "$" << interest << endl;
cout << "Savings Account total:" << setw(3) << "$" << acc_tot << endl;
return 0;
}