Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.26 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.  
  6.     double last_payment, total = 1000 ;
  7.     int count = 0;
  8.     cout << "With this, you can figure out how much will go towards your payment,"
  9.     cout << " and how much will go into your interest payment.";
  10.              
  11.     while (total>50)
  12. {    
  13.     total = total - (50 - total * 0.015);
  14.     count++;
  15.     cout << "month "<< count << " remaining " << total; << "\n";
  16. }
  17.     total= total- total * 0.15;
  18.     cout << "last payment " << total << "\n";
  19.     cout << "You have paid the amount of" << 1000 << " in "<< count << "months\n";
  20. return 0;
  21. }
  22.  
  23.  
  24. // FIX BY MAHORAZ
  25. #include <iostream>
  26. using namespace std;
  27. int main()
  28. {
  29.  
  30.     double last_payment, total = 1000 ;
  31.     int count = 0;
  32.     cout << "With this, you can figure out how much will go towards your payment,"
  33.     cout << " and how much will go into your interest payment.";
  34.              
  35.     while (total>50)
  36. {    
  37.     cout << "interest" << total*0.015 << "\n";
  38.     total = total - (50 - total * 0.015);
  39.     count++;
  40.     cout << "month "<< count << " remaining " << total; << "\n";
  41. }
  42.     total= total- total * 0.15;
  43.     cout << "last payment " << total << "\n";
  44.     cout << "You have paid the amount of" << 1000 << " in "<< count << "months\n";
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement