Advertisement
YTTB

Savings Account NAE NAE

Feb 1st, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.37 KB | None | 0 0
  1. //Dillon Janakus
  2. //Computer Science 1
  3.  
  4. #include <iostream>
  5. #include <string>
  6. #include <iomanip>
  7. #include <cmath>
  8. #include <fstream>
  9. #include <sstream>
  10.  
  11.  
  12. using namespace std;
  13.  
  14. int main()
  15. {
  16.     int startB=  0; //Starting balance
  17.     int intRate= 0; //Interest Rate
  18.     int monthsP= 0; //Number of months passed
  19.     int depoM=   0; //Money deposited during each month
  20.     int intP=    0; //Interest rate percent
  21.  
  22.     cout << "Enter the starting balance of your account: ";
  23.     cin>>(startB);
  24.  
  25.     while(startB<0)
  26.         {
  27.         cout<< "Negative numbers are not accepted, please try again: ";
  28.         cin>>(startB);
  29.         }
  30.  
  31.     cout<<endl;
  32.     cout<< "Enter the annual interest rate: ";
  33.     cin>>(intRate);
  34.  
  35.     while(intRate<0)
  36.         {
  37.         cout<< "Negative numbers are not accepted, please try again: ";
  38.         cin>>(intRate);
  39.         }
  40.     intP = (intRate/100);
  41.  
  42.     cout<<endl;
  43.     cout<< "Enter the number of months that have passed since the account ";
  44.     cout<< "was established: ";
  45.     cin>>(monthsP);
  46.  
  47.     while(monthsP<0)
  48.         {
  49.         cout<< "Negative numbers are not accepted' please try again: ";
  50.         cin>>(monthsP);
  51.         }
  52.  
  53.     cout<<endl;
  54.     for(int m=1; m<=12; m++)
  55.         {
  56.         cout<< "Enter the amount of money was deposited during month "<<m<<": ";
  57.         cin>> (depoM);
  58.  
  59.         }
  60.  
  61.     return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement