Question: Write an interactive Java Program named BankBalanceDoWhile.java which makes use of JOptionPane for input. The program should request you to enter an investment amount. After
Write an interactive Java Program named BankBalanceDoWhile.java which makes use of JOptionPane for input. The program should request you to enter an investment amount. After the investment amount has been entered, it should ask you if you wish to see the balance of your investment after exactly a year. If you wish to see the balance of your investment after exactly a year, you must enter integer 1. The program will ask again after displaying the requested balance if you wish to see your balance after another year. You will keep inputting the integer 1 if you wish to see successive annual balances until the point you input integer 0 if you no longer want to view the next balance. Any other number entered is an error and the program should indicate that error to you, the user. If an error input is received, the program should not terminate but give you a message that you have provided invalid input and should return you to the correct year of balance calculation. For example, if you had entered, say 6, to indicate that you wanted to see the balance for year 4, the program should tell you that the input you provided is not valid. It should then ask you if you still want to view your balance for year 4. This program should exclusively implement the Do While loop and should not implement any methods apart from main().
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
