Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ShowInterest.java For this assignment you are to design and write a banking application that computes interest compounded over time or the future value of an

ShowInterest.java For this assignment you are to design and write a banking application that computes interest compounded over time or the future value of an item that will appreciate over time.

Please make sure that you program output matches the output sample exactly. When the program launches it provides the user with a program description and two options to chose from: Interest and Future value. The user may enter either of these options and it shouldnt matter if upper- or lowercase is used.

If the user chooses the interest option then you will prompt them for a bank name, the starting deposit amount, the number of years, the interest rate and the yearly deposit amount. The resulting screen is a table layout and you will need to use printf() to align the columns properly. When completed you will ask if the customer would like to do a table for another bank and repeat the process if so.

If the user chooses the Future value option then the program will ask them for the items current value, the number of years that will pass before purchasing the item and the inflation rate. The output will show what the future value of the item will be.

Unlike other programs you have written, this program must check for valid input. In no case should your program crash if invalid input is used. For this reason, you will need to implement methods for getting a valid integer, double, yeso, or main menu option. For the integer and double input you will need to use the hasNextDouble() and hasNextInt() methods. For the others you will need to use equalsIgnoreCase().

Methods to implement:

1. public static void run(), this method declares the Scanner object and has a while loop that terminates only when the user answers that there are no more customers. Within the loop you must show the description, get the users option, call either the getInterest() or getFuturePrice() method and then prompt for more customers.

2. public static void description(), this method displays a description of the program.

3. public static String getYesOrNo(Scanner kb,String prompt), This method prints the prompt and loops until it receives a yes or no input by the user. It returns the result.

4. public static String getOption(Scanner kb), This method prints the menu Choose one of and then loops until the user chooses a valid option. It returns the result.

5. public static void getInterest(Scanner kb), This is the method that performs the logic for the Interest menu option.

6. public static void printTable(double amount, int periods, double rate, double deposit, String name), Use this method for printing the table output for the Interest menu option

7. public static double interest(double amount, double rate), This method only computes the interest accrued for given amount and rate and returns it. That is it. It does not print anything to the screen.

8. public static int getValidInt(Scanner kb, String prompt), Prompts the user with the given prompt and loops until an integer is input, returns the integer.

9. public static double getValidDouble(Scanner kb, String prompt), Prompts the user with the given prompt and loops until a double is input, returns the double.

10. public static void getFutureValue(Scanner kb), This is the method that performs the logic for the Future value menu option.image text in transcribed

image text in transcribed

WELCOME TO BANK CALCULATOR, Using this software you can see how money increases over time given particular ntcrcat rate and a regular depoait amount. Thc program o written with parametc so that these values could be changed to compute a different interest rate, number of years, starting amount or deposit amount Choose one of the following options Future value Enter your option--1 Invalid option Enter your option-->interest Enter the name of the bank: Wells Fargo Bank Enter the startinq amount to deposit: 10000 Enter number of years:15 Enter interest rate:1.75 Enter yearly deposit amount:1000 Summary of yearly growth for the bank; ells Fargo Bank Interst Rate:1.75 Intial Amount: 10000.0 Number of years: 15 Yearly Deposit: 1000.0 Year Interest Deposit New Balance 175.00 195.56 216.48 237-77 259.43 281.47 303.90 326.72 349.94 373.56 97.G0 422.06 446.94 472.26 498.03 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 1000.00 10000.00 11175.00 12370.56 13587.05 14824.82 16084.26 17365. 73 18669.63 19996.35 21346.28 22719.84 24117-4 25539.50 26986.44 28458.70 29956.73 10 12 13 14 15 uo you have another bank to compare:yeso yes Enter the name of the bank: Bank of America Enter the starting amount to deposit: 800 Enter number of years:10 Enter interest rate:0.95 Enter yearly deposit amount:50

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

4. What will the team agreement contain?

Answered: 1 week ago