compound - / / / / / compound.cpp By Jonathan Kleid...

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

View Full Document Right Arrow Icon
// 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 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';
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/20/2011 for the course COMPUTER 12 taught by Professor Aymanboghdady during the Spring '11 term at American College of Computer & Information Sciences.

Page1 / 3

compound - / / / / / compound.cpp By Jonathan Kleid...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online