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

Using the following Algorithm, design an UML diagram and write a java program to

ID: 3678418 • Letter: U

Question

Using the following Algorithm, design an UML diagram and write a java program to stimulate the operation of an ATM machine at Caldwell Bank and Trust (CBT).

Algorithm

1.       Start Algorithm

2.       Display welcome Screen

3.       Allow user to slide card

a.       Simulate card sliding by asking user to enter account number

i.                     Check account number against valid account number

-          If number is invalid allow three attempts then print error message “Please contact your financial institution”

-          If number is valid, proceed to step 4.

4. Allow user to enter Personal Identification Number (PIN)

a. Simulate by asking user to enter account number

i. Check PIN against valid PINS.

- If number is invalid, allow three attempts then print error message – Please contact your financial institution.

- If number is valid, then proceed to step 5

5. Display the main Menu

a. Balance Inquire

b. Fast Cash

c. Withdrawal

d. Deposit

e. Quit

6. Allow user to choose from menu – assume MyATM is an object.

a. If choice = a proceed to the method to get the balance (i.e myATM.getBalance())

b. If choice = b proceed to the method to get the fast cash (i.e myATM.getFastCash())

c. If choice = c proceed to the method to get the Withdraw cash (i.e myATM.getWithdrawal())

I. Ask user for amount of withdrawal

ii. If the balance > withdrawal amount proceed with transaction

-          Subtract withdrawal

-          Update balance.

III. if the balance < withdrawal, announce insufficient funds and end transaction.

IV. If the balance = withdrawal amount, display warning message about balance and end transaction.

d. If choice = d proceed to the method to accept the deposit (i.e myATM.getDeposit())

i. Ask user for amount of deposit

ii. Update balance

e. If choice = e proceed to the method to end the transaction (i.e myATM.endTransaction())

i. Print receipt if requested

ii. Print thank you message to customer

7. End Algorithm

                               Test DATA

Valid Account Numbers

Int [] AcctNum = {1234, 2341, 3412, 4123}

VALID PINS

Int [] PIN = {234,341,412,123}

Beginning Balance

Int [] InitBal = {1000, 2000, 300, 0}

Explanation / Answer

Please find the code below :