Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 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.15);
  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.     total = total - (50 - total * 0.15);
  38.     count++;
  39.     cout << "month "<< count << " remaining " << total; << "\n";
  40. }
  41.     total= total- total * 0.15;
  42.     cout << "last payment " << total << "\n";
  43.     cout << "You have paid the amount of" << 1000 << " in "<< count << "months\n";
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement