Advertisement
Guest User

C++TEST

a guest
Feb 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. double savings = 0;
  8. double total = 0;
  9. double interest = 0.05;
  10. cout<<"Enter a monthly saving amount : ";
  11. cin>> savings;
  12.  
  13. for (int i = 0; i < 6; i++){
  14. total = (savings+total) * (1+interest / 12);
  15. }
  16.  
  17. cout<<"The account value after the sixth month is $"<<total<<endl;
  18.  
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement