// Nicolas Ruano CS1A Chapter 3 Pp. #16
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstdlib>
using namespace std;
int main() {
double principal;
double annualRate;
double interest;
double amount;
int timesCompounded;
//INPUT
cout << "Enter the Principal amount: $1000\n";
cin >> principal;
cout << "Enter the annual interest rate: 4.25\n";
cin >> annualRate;
cout << "Enter the number of times interest is compounded per year: 12\n";
//PROCESSING THE INPUT on the annualRate
double rateDecimal = annualRate / 100.0;
//PROCCESSING THE INPUT using the compund interest formula
amount = principal * pow(1 + rateDecimal / timesCompounded,
timesCompounded);
//PROCESS FINAL Results on interests earned
interest = amount - principal;
//OUTPUT - Displaying report
cout << fixed << setprecision(2);
cout << "\n---Savings Account Report ---\n";
cout << "Interest Rate: " << annualRate << "4.25%" << endl;
cout << "Times Compounded: 12" << timesCompounded << endl;
cout << "Principal: $43.34" << principal << endl;
cout << "Interest: $1000" << interest << endl;
cout << "Amount in Savings: $1043.34" << amount << endl;
return 0;
}