IT205 Intro to Object Oriented Programming
Midterm Exam
Your objective for this test is to write a well-documented simple program using classes and loops to simulate an
ATM
Your program must do the following:
1. Create an ATM class with class variables name, pin, and balance, a constructor with parameters to
assign values to the three instance variables, methods to get the name, pin, and balance, and methods to
handle validated deposits and withdrawals ( deposit and withdrawal amounts cannot be negative, and
withdrawal amount must not be greater than the existing balance).
2. In the ATMTest class, read the names, 4 digit pin numbers, and account balances of five or more (max
10) customers into instances of the ATM class. Display the customers names, pins, and balances
formatted.
3. Now that you have all your customers’ information start your ATM to accomplish the following within
an infinite loop,
a. Display a welcome screen with your bank’s information and prompt for and read the customer
entered pin.
b. Match the entered pin with one of the customers’ pins. If the entered pin number matches that of
one of the customers, then:
i. Welcome the customer by name and display the balance.
ii. Display option to
1. DEPOSIT,
2. WITHDRAW or
3. EXIT.
iii. If option 1 is selected, then use the instance deposit method to prompt for deposit
amount, read, and add a valid deposit amount to the customer’s balance
iv. If option 2 is selected, then use the instance withdrawal method to subtract a valid
withdrawal amount from the customers balance
v. If option 3 is selected, go to step a.
4. Should the entered pin number not match that of any of the existing customers, notify the iser that the
entered pin is not valid and go to step a.
5. Selection of the EXIT option must display welcome/login screen
(step a).
6. Should an incorrect option be entered, notify the user and display the original welcome/login screen
(step a).
Test Submissions:
1. Write the pledge and your name in the two java files
2. Ensure the program is well documented, lists the IDE you used for the project, and is easily readable
3. Compress and upload the complete project folder to Blackboard.