Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I already have an Account and Transaction class. I just need help with how to in

ID: 3783728 • Letter: I

Question

I already have an Account and Transaction class. I just need help with how to incorporate them in the main method and class. I don't need an exact answer just a guided example that shows the correct approach and type of code to use.

Requirements:

The ATM system will require users to enter a valid ID . If the entered ID matches to one of the Accounts’ ID, the system will present the user an ATM main menu. The ATM main menu prompts the user to enter a choice, and depending on the user’s choice it may ask for additional input (i.e., withdraw or deposit amount). The code should show for each user choice as shown in the sample-run figure at the end. Description of the sample-run figure (shown at the end): In the main method, create an Array of ten accounts with account IDs as 1, . . . , 10, and an initial balance of $100 for each account. You will use this Array to simulate an ATM machine experience in the main method. To do that, you need a Scanner to capture the user’s input and define a few variables. You should also define a few methods in the main class, to be used inside the main method, to make the main method looks lean. Additional simulation requirements: After creating the 10-element array, the system should prompt the user to enter an ID and it will verify if the ID is a valid one. An ID is valid if it matches to one of the accounts of the 10-element Array. If the ID is valid, the ATM main menu is displayed; otherwise the system will ask the user to enter a correct ID. That is, the system will not present the ATM main menu until the user enters a correct ID. Based on the above ATM simulation description, once the system starts it will not stop because after a user chooses option 4 to exit the ATM system will ask user to enter an ID again. To give users an option exiting the system after a few rounds of ATM simulation, inform users that when entering an ID, enter 0 to exit the ATM run (since valid ids are from 1 to 10). That is, if users enter 0 as ID, instead of showing the main menu, the system will terminate the project, but before that it will print out all ATM transactions for each account (in the Array) that actually incurred transactions.

Explanation / Answer

Main should have the following logic

1) Start infinite loop using while(1)

2) ask user to enter the Id

3) if id is 0 then Quit from while and print the ATM transaction for each account before program terminates.

4) if id entered is between 1 to 10( if( id > 0 && id <=10 )) then step 6

5) if id is not between 1 and 10 ,display Id entered invalid ,then execute from step 1

6) if Id entered between 1 and 10 then use while loop (while(1))

7) presents the user with ATM transaction MENU

8) if user enters 4 then Quit from this while loop (from step 6)

9) else either use switch or if statement to do the required transaction depending on the choice entered by the

user.

User will be in ATM transaction menu till he enters 4 to exit from the while loop from step 6 ..