Question: Simulate an ATM machine using C++ (Multi-dimensional arrays, classes, and header files CANNOT be used. Only use single-dimensional arrays, functions, characters, loops, strings, etc.) The

Simulate an ATM machine using C++

(Multi-dimensional arrays, classes, and header files CANNOT be used. Only use single-dimensional arrays, functions, characters, loops, strings, etc.)

The system should show the following top menu. Write a function called menu that displays this menu.

1. Sign in

2. Balance

3. Deposit

4. Withdraw

5. Exit

We assume that this ATM machine holds account for only 10 people. So, use an array to store clients account balance. Suppose all accounts start with an initial balance of $1000. With this structure in mind we use array indices (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) as user account numbers (a single digit) and array values as balances. The user must first sign in to use the ATM machine by entering their account number (0, 1, 2, 3,.. 9). If the user attempts to use the system without signing in, or enters an incorrect account number the system should give a warning message and display the menu again.

Once signed in a user can request account Balance by entering option 2. Write a function to complete the following task: The function displays the current balance. If balance is below $100, the system should display the message Low Balance then go back to the top menu.

Once signed in the user can request Deposit by entering option 3. Write a function to compete the task: the function should prompt the user to enter the amount. The ATM machine validates the input by verifying that the input is positive. If not, a warning message is displayed invalid amount, and the user is prompted to try again, if amount is negative again, the deposit operation is terminated and the top menu is displayed again. If amount is positive the Balance is updated and the message Deposit completed is displayed. Then back to the top menu.

If option 4, which is Withdraw is selected, write a function to compete the task: the ATM machine prompts the user to enter amount, then checks if user has sufficient Balance. If the balance is insufficient, then a warning message insufficient balance along with users balance is displayed. The user is prompted to enter a new amount for a second time, if amount is OK withdraw operation is completed and balance is updated and menu is displayed. If balance is still insufficient withdraw operation is terminated and top menu is displayed.

For option exit write will a function that display a Good Bye message and exits/log out from users account. The ATM machines menu is displayed, however this time the next user must sign in.

Submit code with comments. Sample runs for each of the options with at least two different users.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!