| Project #4 (ATM) | Passport (Beginners) |
Objective
This project will allow you to practice variables, strings, input/output facilities, conditionals, loops, pseudocode.
Overview
For this assignment you will write an application that allows you to withdraw money from an ATM (Automatic Teller Machine). The program will allow users to input an access code and a specified a dollar amount to withdraw . If the code is valid and the specified amount does not exceed $500.00, then the withdrawal will be authorized. More details about the program are provided in the Specifications section.
This project will be graded as follows:
ATM Access Codes
In the real world, we would like to write a program that can handle a large number of access codes, however, for simplicity, we will assume only two codes can be processed by your program. The codes are 0101 and 0202. Below when we refer to a valid access code we mean one of these two values.
Processing
The processing associated with your program can be divided into two subparts: identifying whether we have a valid access code and verifying whether the specified amount is valid (if any valid code was provided).
Identifying a Valid Access Code
Your program will start by prompting the user for an access code. Your program must display the message "Input access code" in order to read the code. If the user enters a valid access code, your program will proceed to the Validating the Amount component of your program, below. If the user provides an invalid code, your program will notify the user about the invalid code by displaying the message "Invalid access code". After recognizing an invalid code, your program must ask the user whether he/she wants to try another code by displaying the message "Do you want to try another code?". The program will keep repeating the previously described process as long as the user does not provide a valid code and wants to try another code. If the user decides not to try another code, your program will terminate and no further processing will take place.
When your program reaches this point, you know that it has identified one of the valid codes. Next, your program will read the amount of money to withdraw and verify whether the amount does not exceed the corresponding maximum. Your program will read the amount to withdraw using the message "Enter amount to withdraw". After reading this value your program will verify that the amount does not exceed $500.00. If the amount is valid the message "Withdrawal authorized" will be generated and the program will end. Otherwise, the message "Request denied" will be displayed. The program will give the user three opportunities to enter a correct amount; after the third attempt the program will terminate after "Request denied" has been displayed.
Requirements
Submission
To submit your project e-mail the html file (atm.html) and the pseudocode (pseudocode.txt) as attachments in a single e-mail message to costerho@umd.edu Use as subject "Passport Beginner Project #4" and make sure you write your name on the message.