Java: Please write in Java 1. Declare an object array with 10 accounts. 2. Create a for loop to ask user to input each a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Java: Please write in Java 1. Declare an object array with 10 accounts. 2. Create a for loop to ask user to input each a

Post by answerhappygod »

Java: Please write in Java
1. Declare an object array with 10 accounts.
2. Create a for loop to ask user to input each account’sinformation (name, account number, and initial balance) fromkeyboard and then initialize for each account object.
3. Create a while loop to allow one to work on accounts till onewant to exit. In each loop, the program will ask one to input thename of the owner. a. Write code to searchthe account object array to find the object that has the rightowner name (you will get bonus points if you write the accountsearching part as a static method and simply call this method). Ifan account is not found, ask user to try to search another name orquit the program. b. If an account isfound, ask user to choose withdrawing or depositing operation andalso indicate the amount. Then perform the corresponding operationon the selected account. Your program should allow one to work ondepositing and withdrawing operations as many times as they liketill they decide to quit. Hint: you might want to design anotherwhile loop here.
4. Outside of the while loop for the account operations, write afor loop to print the summary for each account by calling thedisplayAccount() method.
Test cases:You should provide at least the following test cases:(1) Input an owner name that does not have an account exist. Thecorrect program should ask one to try input a different name.(2) Input an owner name that exists. The correct program shouldallow you to choose the operations. For this account, try at leastthree operations that include at least one deposit and one withdrawoperations. Also show that you could exit the operations for thisaccount after you make a right input.(3) Show that you could exit the whole program after making a rightinput
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply