SHARE
TWEET

Untitled

a guest Feb 16th, 2020 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. package loaner;
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class LOANER {
  7.  
  8.  
  9.     public static void main(String[] args){
  10.    
  11.      
  12.        
  13.                 String name;
  14.         Double amount_loan, interest, y_loan, r, t, annual_ammor, monthly_ammor;
  15.        
  16.         Scanner x = new Scanner (System.in);
  17.        
  18.         System.out.println("Borrower Name: ");
  19.         name = x.nextLine();
  20.         System.out.println("Amount of Loan: ");
  21.         amount_loan = x.nextDouble();
  22.         System.out.println("Year/Term of loan: ");
  23.         y_loan = x.nextDouble();
  24.        
  25.         if (y_loan >= 16){
  26.             r = 0.15;
  27.         }
  28.         else if (y_loan >= 3 && y_loan <= 4){
  29.             r = 0.05;
  30.         }
  31.         else if (y_loan >= 5 && y_loan <= 7){
  32.             r = 0.06;
  33.         }
  34.         else if (y_loan >= 8 && y_loan <= 9){
  35.             r = 0.07;
  36.         }
  37.         else if (y_loan >= 10 && y_loan <= 11){
  38.             r = 0.08;
  39.         }
  40.         else if (y_loan >= 12 && y_loan <= 15){
  41.             r = 0.10;
  42.         }
  43.         else {
  44.             r = 0.12;
  45.         }
  46.     interest = amount_loan * (r * y_loan);
  47.     System.out.println("Interest Rate: " + interest);
  48.    
  49.     t = amount_loan + interest;
  50.     System.out.println("Total Loan: " + t);
  51.    
  52.     annual_ammor = t/y_loan;
  53.     System.out.println("Annual Amortization: " + annual_ammor);
  54.    
  55.     monthly_ammor = annual_ammor/12;
  56.     System.out.println("Mothly Amortization: " + monthly_ammor);
  57.    
  58.     System.exit(0);
  59.    
  60.         }
  61.    
  62.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top