Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

NATIONAL UNIVERSITY

of Computer & Emerging Sciences, Lahore


Department of Computer Science

Course: Programming Fundamentals (CS118) – Undergraduate


Class
Section: J
Assignment No: 4
Total Marks: 16.0
Total Weight: 8.0
Assignment Date: 29 Oct 2019
Assignment Due Date/Time: 04 Nov 2019/until 3:00 pm
Development Environment: MS Visual Studio 2012
Marks Distribution: User Interface / Output : 2 marks
Use of Functions, Arrays, Design : 6 marks
Reports : 8 marks

Submission Instructions: 1. Name your .cpp file with your “ROLLNO-SEC”


(e.g. for Roll No. 19L1234, Sec K – the file name should be
“19L1234-K.cpp”). Then place the file in a folder named
after your ROLLNO. Zip the folder. Attach the zipped
folder to submit on SLATE. 

2. DO NOT submit anything other than your .cpp source


file.

3. Failure to follow the assignment upload instructions (1


& 2 above) will result in deduction of 5 Marks.

4. DO NOT wait for the last hour to submit your


assignment, you may run into network issues. SLATE
generates an automated email if your operation (upload
file) is successful. Keep “Successful assignment
Submission/Confirmation Email” from SLATE, in your
Inbox, until ALL course assignments are marked. In case
of issues, the email will be required by Instructor/TA to be
seen in your Mail Inbox.

5. If you are not able to upload assignments to SLATE, due


to system issues, contact SLATE administrator
(slatelhr@nu.edu.pk) FIRST. In case SLATE having issues
close to deadline, you should email (at least 2 hours
before the deadline) TA/Instructor detailing issue with
evidence (SLATE screenshot, email). An alternative can be
provided for uploading assignment, which will be informed
to the respective student(s) by TA/Instructor.

1
6. No late assignments will be marked.

7. Students found plagiarizing, such cases will be


forwarded to Disciplinary Action Committee.

Evaluations: If applicable, TA will put up a schedule for evaluations


after deadline. You will be provided ample
notice/instructions to prepare as needed. If you miss the
evaluation, your assignment will not be marked.

TA: Mr. Rohan - l174066@lhr.nu.edu.pk

Problem Statement:

ATM MACHINE (Phase II)

In this assignment you will create a program, in C++, that allows a user to do the
following:

MAIN MENU

1) Create a user bank account by supplying a User ID and Password.


2) Login using ID and Password.
3) Access Admin Console
4) Quit the program.

Now if login was successful the user will be able to do the following:

OPERATIONS MENU

1) Withdraw money.
2) Deposit money.
3) Request balance.
4) ‘Transaction History’ is a REPORT– following fields will be displayed
a. Account ID
b. Date/Time of Transaction – format (DDMMYYYY | HH:MM:SS)
c. Activity Type – (Withdraw or Deposit)
d. Transaction Amount (+ive for Deposit e.g. Rs. 350.00 and –ive for
withdrawl e.g. Rs. -200.00)
e. Current Balance Amount

2
- show the transaction history for at least the last 3 transactions, if
more than 3 transactions in total. Otherwise show all transactions if 3 or
less transactions.

- Order the transaction History based on Date/time of Transaction.

5) Highest and Lowest Amount Transaction (for User ID) is a REPORT – following
fields will be displayed
a. “Highest Transaction : “ (can be a withdrawl of Rs. 1000)
b. “Lowest Transaction : “ (can be a deposit of Rs. 10)
6) Go back to Main Menu.

If login was not successful (for example, the User ID and password did not match)
then the user will be taken back to the main menu.

You should only be able to select option “3) Access Admin Console” in Main Menu
when NO user is logged in.

ADMIN CONSOLE

All reports below will work only for current session.

1) ‘REPORT on Total number of transactions’ (Withdraws and Deposits) from ALL


accounts.
a. Account ID
b. Date
c. Total Number of Transactions (both Withdrawl and Deposits)
2) ‘REPORT on ALL Account Balances’ in the Ascending Order, (hint -> Use Sorting)
a. Account ID
b. Current Balance Amount
3) Go back to Main Menu

Rules

1. Implement the program using C++ Functions and Arrays. Features such
as
a. Login
b. Withdraw Money
c. Deposit Money

3
d. Transaction History etc.
are ideal candidates for implementation using Functions for each feature.

2. You can use all concepts learned so far in the course.


3. DO NOT use any C++ built-in functions from libraries such as math, string,
stdlib etc. You can use BREAK and CONTINUE statements. You can use clrscr()
or similar functions, BUT not any functions for computation/calculation.
4. A user ID can only comprise of positive integer. Only 5 accounts should be
created and maintained.
5. When you are creating a User ID, it should not comprise of non-integer
pattern such as characters, special/alpha-numeric characters and/or string
values. If a user enters a non-numeric User ID, during account creation,
system should display an error message and ask User ID again.
6. Login should prompt for both User ID and Password. Both user ID and
password should match for a user to log in successfully.
7. If a user login exists and the user tries to creates an account with the same
Account ID, system should throw an error and NOT create a supplicate user
account.
8. When creating an account or during login, as a user enters password – the
actual password should not be displayed on the screen rather asterisks (*) for
each key pressed by the user. A password could comprise of any valid
pattern of keys (such as numeric, characters, special or a mix of all etc.) on
the keyboard.
9. If a User ID exists, the user should be able to login and see the OPERATIONS
MENU. Otherwise, keep going back to MAIN MENU displaying a message that
“User ID does not exist”.
10.If user logout after depositing money then logins again without quitting then
user will be able to see his/her previously deposited money, as the session as
not expired.
11.User should be able to select Menu options, entering numeric values (1, 2, 3,
4 etc.) or characters (l, w, e etc.) representing an option. It is your choice to
use the scheme that you want.
12.User should ONLY be able to see his/her transactions within the OPERATIONS
MENU.
13.Initial BALANCE for each account should be 0.
14.For the choice below, post successful login

4
Withdraw money.

 The ATM system should only take numeric value. System should prompt
an error if a character, string or an alpha-numeric character is entered.
System should ask again for the Deposit Amount until a correct value is
entered.
 Note that the ATM system can only dispense currency notes that are
available e.g. 5000, 1000, 500, 100, 50, 20 and 10). So system should not
accept withdrawal amounts such as 5542, 308 etc. System should as
again for the Deposit Amount until a correct value is entered.
 For the amount of withdrawal needed, since this is not a real ATM, you
should display on the screen
o Currency note denomination(s) & Number of note for each
denomination dispatched e.g. if 540.00 is entered by the user for
withdrawal, the message on the screen be like
“Cash Withdrawal for Rs. 540 requested
a. Denomination 100s – 5
b. Denominations 20s – 2
 System should not accept any values for change e.g. 350.42. As the ATM
cannot dispense change/coins. So the user should only be able to enter
values like 300.00, 560.00 etc. System should ask again for the Deposit
Amount until a correct value is entered.
 System should not dispense money more than the current account
balance.
15.For the choice below, post successful login

Deposit money.

 The ATM system should only accept numeric values (both integer and
decimal). System should display an error if a character, string or an alpha-
numeric character is entered. System should ask again for the Deposit
Amount until a correct value is entered.
 A user should be able to deposit change e.g. 5988.81 is a valid deposit
amount.

5
This is what your program in action will look like. NOTE that this depiction is by
no means a complete representation of the final program and its output.
This is JUST A REFERENCE:

Hi! Welcome to Mr. Zamar’s ATM Machine!

Please select an option from the menu below:

l -> Login

c -> Create New Account

q -> Quit

>l

Please enter your user id: 6

******** LOGIN FAILED! ********

Please select an option from the menu below:

l -> Login

c -> Create New Account

q -> Quit

>c

6
Please enter your user name: 1

Thank You! Your account has been created!

l -> Login

c -> Create New Account

q -> Quit

>l

Please enter your user id: 1

Access Granted!

d -> Deposit Money

w -> Withdraw Money

r -> Request Balance

m -> Go back to Main Screen.

>d

Enter Amount of deposit:

>Rs. 1000.54

Amount credited successfully

d -> Deposit Money

w -> Withdraw Money

r -> Request Balance

7
m -> Go back to Main Screen.

>r

Your balance is RS.1000.

d -> Deposit Money

w -> Withdraw Money

r -> Request Balance

m -> Go back to Main Screen.

>w

Amount of withdrawal:

> Rs. 500

d -> Deposit Money

w -> Withdraw Money

r -> Request Balance

m -> Go back to Main Screen.

>r

Your balance is Rs. 500.54

d -> Deposit Money

w -> Withdraw Money

r -> Request Balance

8
m -> Go back to Main Screen.

>m

l -> Login

c -> Create New Account

q -> Quit

>q

Display – “Thanks for stopping by User 1! BYE”

When the user press ENTER, the system goes back to Main Menu and the
user can start all over again.

You might also like