-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestLoan.java
More file actions
25 lines (18 loc) · 797 Bytes
/
TestLoan.java
File metadata and controls
25 lines (18 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package objectAndClass;
import java.util.Scanner;
public class TestLoan {
public static void main (String[]args){
Scanner input= new Scanner (System.in);
System.out.print("Annual Interest RAte:");
double annualInterestRate= input.nextDouble();
System.out.println("Enter Years:");
int numbersOfYears= input.nextInt();
System.out.println("Enter Loan Amount");
double loanAmount= input.nextDouble();
Loan loan = new Loan(annualInterestRate, numbersOfYears, loanAmount);
//System.out.printf("The loan was created on %s\n"
//+"The monthly payment is %.2f\n The total payment is %.2f\n",loan.getLoanDate().toString(),loan.getMonthlyPayment(),loan.getTotalPayment());
System.out.printf("monthly payment is=%.2f",loan.getMonthlyPayment());
input.close();
}
}