Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Dillon Janakus
- //Computer Science 1
- #include <iostream>
- #include <string>
- #include <iomanip>
- #include <cmath>
- #include <fstream>
- #include <sstream>
- using namespace std;
- int main()
- {
- int startB= 0; //Starting balance
- int intRate= 0; //Interest Rate
- int monthsP= 0; //Number of months passed
- int depoM= 0; //Money deposited during each month
- int intP= 0; //Interest rate percent
- cout << "Enter the starting balance of your account: ";
- cin>>(startB);
- while(startB<0)
- {
- cout<< "Negative numbers are not accepted, please try again: ";
- cin>>(startB);
- }
- cout<<endl;
- cout<< "Enter the annual interest rate: ";
- cin>>(intRate);
- while(intRate<0)
- {
- cout<< "Negative numbers are not accepted, please try again: ";
- cin>>(intRate);
- }
- intP = (intRate/100);
- cout<<endl;
- cout<< "Enter the number of months that have passed since the account ";
- cout<< "was established: ";
- cin>>(monthsP);
- while(monthsP<0)
- {
- cout<< "Negative numbers are not accepted' please try again: ";
- cin>>(monthsP);
- }
- cout<<endl;
- for(int m=1; m<=12; m++)
- {
- cout<< "Enter the amount of money was deposited during month "<<m<<": ";
- cin>> (depoM);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement