{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# compound - compound.cpp By Jonathan Kleid Calculates future...

This preview shows pages 1–2. Sign up to view the full content.

// compound.cpp // By Jonathan Kleid // Calculates future value of an amount of money placed in an interest // bearing account over time. / #include <iostream.h> #include <iomanip.h> #include "apstring.h" # // function prototypes void get_user_input(double &principal, double &interest_rate, int &first_year, int &first_month, int &total_months); void calculate_principal(double &principal, double interest_rate); void print_date(int year, int month); v // main function int main() { double principal, interest_rate; int first_year, first_month, total_months, month_count, current_year, current_month; apstring Wait; // used in "Press Enter to Continue" input get_user_input(principal, interest_rate, first_year, first_month, total_months); current_year = first_year; current_month = first_month; cout.setf(ios::fixed); // prevent exponential notation for (month_count = 0; month_count < total_months; month_count++) { print_date(current_year, current_month); cout << "\$" << setprecision(2) << principal << '\n'; calculate_principal(principal, interest_rate); if (current_month < 12) { // If not yet December, increment month

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

compound - compound.cpp By Jonathan Kleid Calculates future...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online