The credit plan at TidBit Computer Store specifies a 10% down payment and an ann
ID: 3662979 • Letter: T
Question
The credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest rate of 12%. Monthly payments are 5% of the listed purchase price, minus the down payment. Write a program that takes the purchase price as input. The program should display a table, with appropriate headers, of a payment schedule for the lifetime of the loan.
Each row of the table should contain the following items:
the month number (beginning with 1)
the current total balance owed
the interest owed for that month
the amount of principal owed for that month
the payment for that month
the balance remaining after payment
The amount of interest for a month is equal to balance * rate / 12. The amount of principal for a month is equal to the monthly payment minus the interest owed. Done in python
Explanation / Answer
import java.util.Scanner; 02 03 public class TidBitComputerStore { 04 05 public static void main(String[] args) { 06 07 Scanner priceInput = new Scanner(System.in); 08 09 System.out.println("Enter the purchase price: "); 10 double listedPurchasePrice = priceInput.nextDouble(); 11 12 13 double downPayment = 0.1; 14 double annualInterestRate = 0.12; 15 double monthlyPayments = (0.5 * listedPurchasePrice) - downPayment; 16 double monthNumber = 0; 17 double currentBalanceOwed = listedPurchasePrice; 18 double interestOwnedThatMonth = currentBalanceOwed * annualInterestRate / 12; 19 double amountOfPrincipalOwedThatMonth = monthlyPayments - interestOwnedThatMonth; 20 double paymentForThatMonth = 0; 21 double balanceRemainingAfterPayment = 0; 22 23 while(currentBalanceOwed > 0) { 24 if(monthNumber == 0 ) { 25 currentBalanceOwed = currentBalanceOwed * downPayment; 26 } 27 currentBalanceOwed = currentBalanceOwed * downPayment * interestOwnedThatMonth ; 28 29 monthNumber++; 30 31 System.out.println(monthNumber); 32 System.out.println(currentBalanceOwed); 33 System.out.println(interestOwnedThatMonth); 34 System.out.println(amountOfPrincipalOwedThatMonth); 35 System.out.println(paymentForThatMonth); 36 System.out.println(balanceRemainingAfterPayment); 37 38 39 } 40 41 42 } 43 44 45 46 }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.