A+ Answers



Task 1
iBank wants to develop its own ATM system. The system will look and work much like other competitor systems work. You have been asked to develop the software for the system. This software will allow customers to withdraw cash and check their balance.

a) Using the approach to problem solving learned in class, identify:
The principal parts (sub-problems) of the problem.
Any assumptions you are making with regards to the problem.
b) In pseudo code, outline the basic steps (no more than five) involved in withdrawing cash (Do not include any choice or iteration at this point).   
Task 2 – Start-up
The process of withdrawing cash will begin only if a customer card is entered. Add a simple IF/ENDIF statement to your pseudo code that will account for the customer inserting a card. Please note that if a customer does not insert a card, then NONE of the steps in the cash withdrawal, or balance checking process, should happen.
Task 3 – Pin Entry
Once a card has been inserted into the machine, a customer should be prompted to enter their PIN in order to proceed further. We will assume at this point that the customer has an unlimited number of attempts at entering the correct PIN.

Identify the variables required for the checking of the PIN. Provide a data type, description and data range for each variable.
b) Use a loop to check the entered PIN number against a customer’s stored PIN number. Make sure you use and initialize the variables you identified in (a).
Task 4 – Menu Choices
Once a correct PIN has been entered, customers will be presented with a services menu. The services menu screen will provide two choices: Check Balance and Withdraw Cash. These choices can be made by selecting buttons 1 or 2 on the menu screen (Figure 1).
a) Identify any further variables that you would need to implement the menu. Provide a data type, description and data range for each variable.
b) Using nested conditional statements. Represent the menu choices detailed above. Note that the outer conditional statement should deal with the service choice, and the inner conditional statement should deal with the withdrawal choice.
Task 5 – Dispensing Cash
Once the customer has chosen the amount he/she wishes to withdraw, the ATM should dispense the cash and return the card. The cash should be dispensed in the optimum number of notes (Note that the machine dispenses only twenty and ten pound notes. You can assume that the machine has an unlimited supply of both tens and twenties).

Identify any further variables that you would need to implement the dispensing of cash problem. Provide a data type, description and data range for each variable.
b) Extend your algorithm so that it calculates the optimum number of notes for any requested amount. Thus, if a customer chooses to withdraw £100, the optimum format for the cash to be dispensed would be five twenties, while if the customer chooses to withdraw £50 the optimum format for the cash would be two twenties and one ten.
c) Use an appropriate loop structure to return the cash to be dispensed to the customer. Note that you need one loop for tens, and one loop for twenties.  
Task 6 – Limiting PIN Attempts
A customer should be allowed only three attempts at entering a correct PIN before their card is retained.

c) Identify any further variables that you would need to implement the limitation of PIN attempts to three. Provide a data type, description and data range for each variable.

a) Adapt the PIN verification loop from task 3, so that the customer has only three attempts at entering a correct PIN number. If, after three attempts, a correct PIN has not been entered, then the customer’s card should be retained, and none of the subsequent steps should happen.

To complete this task, you will need to adapt the loop structure you created in task 3. You will need to create a variable for the number of allowed attempts at entering a PIN. Each time the customer has a failed attempt at a correct PIN entry; this variable should be decremented by one. When there are no more attempts left, the loop should exit. This will require a compound loop condition that takes account of (a) whether a correct PIN has been entered (b) whether there are any PIN attempts remaining.

Task 7 – Documentation

Provide a short description (max 100-200 words) for your completed algorithm.
b) Add explanatory comments to the pseudo code.