// Lab 2, problem 2. import java.util.Scanner; class LoanInterest { public static void main (String[] args) { Scanner scan = new Scanner(System.in); System.out.print ("Enter the amount borrowed: "); System.out.flush(); float amount = scan.nextFloat(); System.out.print ("Enter the interest rate (in %): "); System.out.flush(); float rate = scan.nextFloat(); System.out.print ("Enter the time of the loan (in years): "); System.out.flush(); float time = scan.nextFloat(); float interest = amount * (rate/100) * (time/365); System.out.println ("For " + amount + " borrowed for " + time + " years and an interest rate of "); System.out.println (rate + "%, you have to pay " + interest + " interest per day, or "); System.out.println (interest*365 + " per year."); } }