Advertisement
iArcsinE

Finals Pseudocode

May 21st, 2021
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. float balance = 1000;
  2. int totalPayments = 0;
  3. int monthly;
  4. int monthNum = 0;
  5.  
  6. print "Enter the amount to be paid monthly: ";
  7. get input for monthly
  8. while(balance >= monthly) {
  9. totalPayments += monthly;
  10. ++monthNum;
  11. balance = (balance - monthly) + (balance * 0.015);
  12. print "Months: " + monthNum + "Balance: " + balance + "total payments: " + totalPayments;
  13. }
  14. print "Remaining balance can be paid with the exact amount of " + balance;
  15.  
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement