Write a Java program called "InterestCalculater"that do the following: 1). Prompt the user to input principal, interest and loan term. 2). Calculate and display the total interest amount to be paid by the borrower at the end of the loan term. 3). Calculate and display the total amount to be paid by the borrower at the end of the loan term.
Show me your attempt so far.
Try something like this: import java.util.Scanner; class GetUserInput { public static void main(String args[]) { int loanTerm; float principalAmount, interestRate; Scanner in = new Scanner(System.in); System.out.println("Enter Principal Amount: "); principalAmount = in.nextLine(); System.out.println("Enter Interest Rate: "); interestRate = in.nextFloat(); System.out.println("Enter Loan Term: "); loanTerm = in.nextInt(); System.out.println(" Principal :"+principalAmount); System.out.println(" Interest Rate :"+interestRate); System.out.println(" Term :"+loanTerm); System.out.println(" Total payoff :"+principalAmount * interestRate * loanTerm); } }
Join our real-time social learning platform and learn together with your friends!