Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java program, please show the output of this program. A local bank intends to install a new automated teller machine (ATM) to allow users

In Java program, please show the output of this program.

image text in transcribedimage text in transcribed

image text in transcribed

A local bank intends to install a new automated teller machine (ATM) to allow users (i.e., bank customers) to perform basic financial transactions (Fig. 12.1). Each user can have only one account at the bank. ATM users should be able to view their account balance, withdraw cash (i.e., take money out of an account) and deposit funds (i.e.. place money into an account). An ATM session consists of authenticating a user (i.e. proving the user's identity) based on an account number and personal identification number (PIN), followed by creating and executing financial transactions. To authenticate a user and perform transactions, the ATM must interact with the bank's account information database. For each bank account, the database stores an account number, a PIN and a balance indicating the amount of money in the account. Furthermore, we assume that the bank does not make any changes to the information in the database while a user is accessing the ATM. System Description The bank trusts the ATM to access and manipulate the information in the database without significant security measures. Upon first approaching the ATM (assuming no one is currently using it), the user should experience the following sequence of events: 1. The screen dispiays Welcomel and prompts the user to enter an account number. 2. The user enters a five-digit account number. 3. The screen prompts the user to enter the PIN-(personal identification number) associated with the specified account number. 4. The user enters a five-digit PIN 5. If the user enters a valid account number and the correct PIN for that account, the screen displays the main menu (Fig. 12.2). If the user enters an invalid account number or an incorrect PIN, the screen displays an appropriate message, then the ATM returns to Step 1 to restart the authentication process. After the ATM authenticates the user, the main menu should contain a numbered option for each of the three types of transactions: balance inquiry (option 1), withdrawal (option 2) and deposit (option 3). It also should contain an option to allow the user to exit the system (option 4). The user then chooses either to perform a transaction (by entering 1, 2 or 3) or to exit the system (by entering 4). If the user enters I to make a balance inquiry, the screen dispiays the user's account balance. To do so, the ATM must retrieve the balance from the bank's database. The following steps describe what occurs when the user enters 2 to make a withdrawal: 1. The screen displays a menu containing standard withdrawal amounts: $20 (option 1). $40 (option 2), $60 (option 3). $100 (option 4) and $200 (option 5). The menu also contains an option to allow the user to cancel the transaction (option 6). 2. The user enters a menu selection using the keypad. 3. If the withdrawal amount chosen is greater than the user's account balance, the screen displays a message stating this and telling the user to choose a smaller amount. The ATM then returns to Step 1. If the withdrawal amount chosen is less than or equal to the user's account balance (i.e., an acceptable amount), the ATM proceeds to Step 4. If the user chooses to cancel the transaction (option 6), the ATM displays the main menu and waits for user input. 4. If the cash dispenser contains enough cash, the ATM proceeds to Step 5. Otherwise, the screen displays a message indicating the problem and telling the user to choose a smaller withdrawal amount. The ATM then returns to Step 1. 5. The ATM debits the withdrawal amount from the user's account in the bank's database (l.e., subtracts the withdrawal amount from the user's account balance). 6. The cash dispenser dispenses the desired amount of money to the user. 7. The screen displays a message reminding the user to take the money. The following steps describe the actions that occur when the user enters to make a deposit: 1 . The screen prompts the user to enter a deposit amount or type 0 (zero) to cancel. 2 . The user enters a deposit amount or 0 using the keypad. [Note: The keypad does not contain a decimal point or a dollar sign, so the user cannot type a real dollar amount (e.g. \$27.25). Instead, the user must enter a deposit amount as a number of cents (e.g. 2725). The ATM then divides this number by 100 to obtain a number representing a dollar amount (e.g. 27a5 100= 27.25). 3. If the user specifies a deposit amount, the ATM proceeds to Step 4. If the user chooses to cancel the transaction (by entering 0), the ATM displays the main menu and waits for user input. 4. The screen displays a message telling the user to insert a deposit envelope. 5. If the deposit siot recelves a deposit envelope within two minutes, the ATM credits the deposit amount to the user's account in the bank's database fi.e, adds the deposit amount to the user's account balance). [Note: This money is not immediately available for withdrawal. The bank first must physically verify the amount of cash in the deposit envelope, and any checis in the envelope must clear (i.e. money must be transferred from the check writer's account to the check recipient's account). When either of these events occurs. the bank appropriately updates the user's balance stored in its database. This occurs independently of the ATM system.] if the deposit siot does not receive a deposit envelope within this time period, the screen displays a message that the system has canceled the transaction due to inactivity. The ATM then displays the main menu and waits for user input. After the system successfully executes a transaction, it should return to the main menu so that the user can perform additional transactions. If the user exits the system, the screen should display a thank you message, then display the welcome message for the next user. List of Classes - ATM - Screen - Keypad - CashDispenser - DepositSlot - Account - BankDatabase - Transaction - AtMCasestudy List of Methods - Balancelnquiry - Withdrawal' - Deposit Note: - Use array as your database - Assign value to your array for the balance and account Welcome! Please enter your account number: 12345 Enter your PIN: 54321 Main menu: 1 - View my balance 2 - Widthraw cash 3 - Deposit funds 4 - Exit Enter a choice: 1 Balance Information:Available balance: $1,000.00 Total balance: $1,200.00 Main menu: 1 - View my balance 2 - Widthraw cash 3 - Deposit funds 4 - Exit Enter a choice: 3 Please enter a deposit amount in CENTS (or 0 to cancel): 1000 Please insert a deposit envelope containing \$10.00. Your envelope has been received. NOTE: The money just deposited will not be available until we verify the amount of any enclosed cash and your checks clear. Main menu: 1 - View my balance 2 - Widthraw cash 3 - Deposit funds 4 - Exit Enter a choice: 1 Balance information:Available balance: $1,000.00 Total balance: $1,210.00 Main menu: 1 - View my balance 2 - Widthraw cash 3 - Deposit funds 4 - Exit Enter a choice: 4

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

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions