Question: ** Please help me understand what each line does and my columns in the left picture, do not match the ones in the picture on

** Please help me understand what each line does and my columns in the left picture, do not match the ones in the picture on the right

import java.text.DecimalFormat;

import java.util.Scanner;

public class LiFiUnit4Ch13

{

public static void main(String[] args) {

LiFiUnit4Ch13Investor investor1 = new LiFiUnit4Ch13Investor(1001, 2000);

LiFiUnit4Ch13Investor investor2 = new LiFiUnit4Ch13Investor(2001, 4000);

Scanner scanner = new Scanner(System.in);

System.out.print("Please Enter the APR in the form of .05 for 5% : ");

double interestRate = scanner.nextDouble();

LiFiUnit4Ch13Investor.setInterestRate(interestRate);

System.out.println("Month\tAccount #\tBalance\tAccount #\tBalance");

DecimalFormat format = new DecimalFormat("#.00");

for (int i = 1; i

{

investor1.addInterest();

investor2.addInterest();

System.out.println(i + "\t" + investor1.getACCOUNT_NUMBER()

+ "\t\t" + format.format(investor1.getBalance()) + "\t"

+ investor2.getACCOUNT_NUMBER() + "\t\t"

+ format.format(investor2.getBalance()));

}

System.out.println("Investor1 earned : "

+ format.format((investor1.getBalance() - 2000))

+ " interest in 15 months at "

+ format.format(interestRate * 100)+"% ");

System.out.println("Investor1 earned : "

+ format.format((investor2.getBalance() - 4000))

+ " interest in 15 months at "

+ format.format(interestRate * 100)+"% ");

}

}

*******************

public class LiFiUnit4Ch13Investor {

public static double interestRate;

final int ACCOUNT_NUMBER;

private double balance;

public LiFiUnit4Ch13Investor(int aCCOUNT_NUMBER, double balance) { ACCOUNT_NUMBER = aCCOUNT_NUMBER; this.balance = balance; }

/** * @param interestRate * the interestRate to set */ public static void setInterestRate(double interestRate) { LiFiUnit4Ch13Investor.interestRate = interestRate; }

/** * */ public void addInterest() {

balance += balance * (interestRate / 12); }

/** * @return the interestRate */ public static double getInterestRate() { return interestRate; }

/** * @return the aCCOUNT_NUMBER */ public int getACCOUNT_NUMBER() { return ACCOUNT_NUMBER; }

/** * @return the balance */ public double getBalance() { return balance; }

}

** Please help me understand what each line does and my columns

Please Enter the APR in the form of -e5 for 5% .5 Month Account # ease enter the APR In the forn of- for sx 8 Monthly balances for one year with 8.88 annual interest: honthAccount # Balance Account# Balance investori earned : 128 . 71 interest in 1 months at 5.% Investor! earned : 257-42 nterest in 1 months at 5.00% Press any key to continue . . . Investorl earned 209.61 interest in 15 nonths t 8.80 Investor2 earned : 419.22 interest in 15 nonths t 8.00 e7-8354923 5762 c642eee-25826174 5a6374185297429755 1135 13568 235 B444444444444444aa 5 A222222222222222ss e3422756-2881 a865320976432-98nn B222222222222222-2e C3715) 5 6 2 9 6 3 8 7 e 4 87i 3 rrn 0a 12345nn -?13429480110852 6S5?164 3583 892 630?S208 -222222222222222 -36??65295-5e481 12 372853212466496 62 36 ?1593?1604 a-1245 06 88 9 1 2 3 5 6 8 92 24 sh h-123456?89012345

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!