SHARE
TWEET

Untitled

a guest Sep 13th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.text.DecimalFormat;
  2. import java.util.Scanner;
  3.  
  4. public class Lab7
  5. {
  6.    static Scanner console = new Scanner (System.in);
  7.    
  8.    public static void main (String args[])
  9.    {
  10.       int years;
  11.       double amount, rate, payment;
  12.       amount = getAmount(result);
  13.       rate = getRate(result);
  14.       years = getYears(result);
  15.    } //Main  
  16.    
  17.    public static double getAmount(double result)
  18.    {
  19.       System.out.println("Enter the amount to be borrowed: ");
  20.       result = console.nextDouble;  
  21.       return result;
  22.    } //getAmount
  23.    
  24.    public static double getRate(double result)
  25.    {
  26.       System.out.println("Enter the annual interest rate as a percent: ");
  27.       result = console.nextDouble;
  28.       return result;
  29.    } //getRate
  30.    
  31.    public static int getYears(int result);
  32.    {
  33.       System.out.println("Enter the length of the loan in years: ");
  34.       result = console.nextInt;
  35.       return result;
  36.    } //getYears
  37.      
  38. } //Lab7
RAW Paste Data
Top