Question: I need help developing a Java program that reads input from the keyboard using a Scanner Object and its methods, uses selection ( if and
I need help developing a Java program that reads input from the keyboard using a Scanner Object and its methods, uses selection (if and if else) statements, use iteration (looping) and follows standard acceptable programming practices.
Write a Java program named InterestCalculator.java that calculates the value of a bank account based on starting principle, interest rate and time.
Prompt the user for
Number of quarters to display (int) that is greater than zero and less or equal to 10.
Starting balance (double) that is greater than zero.
Interest rate (double) that is greater than zero and less than or equal to 20%
Display the information the user entered and ask if it is correct. If so continue, if not ask for all the information again (loop and half example in Addition Iteration examples).
Calculate the ending balance for each quarter and display the results in a table similar to below, the formula for quarterly balance is b + (b * IR/100 * .25) where b is starting balance and IR is interest rate :
EX Output:
Enter number of quarters from 1 to 10
8
Enter beginning principal balance greater than 0
1000
Enter the interest rate percentage without the percent sign
greater than 0% and less than/equal to 20%
5.25
You entered a principal balance of $1000.00 for 8 quarters at 5.25& interest
Is this correct (y/n)
Y
Quarter Beginning Interest Ending
Number Balance Earned Balance
1 $1000.00 $13.13 $1013.13
2 $1013.13 $13.30 $$1026.42
-In addition, if the user enters a value outside the boundaries listed above, prompt them with an error message and ask for the value again(Loops).
NOTES
-Whoever answers this PLEASE, keep it simple. We are only on chapter 4 of a beginners Java Class.
-Please answer in Java
-Here is an example of a simple caluculation from chapter 2 that we have been working so you can see how basic our knowledge is.
import java.util.Scanner;
public class ShippingCalculator {
public static void main (String [] args) {
int shipWeightPounds = 10;
int shipCostCents = 0;
final int FLAT_FEE_CENTS = 75;
final int CENTS_PER_POUND = 25;
shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;
System.out.println("Weight(lb): " + shipWeightPounds);
System.out.println("Flat fee(cents): " + FLAT_FEE_CENTS);
System.out.println("Cents per pound: " + CENTS_PER_POUND);
System.out.println("Shipping cost(cents): " + shipCostCents);
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
