Hello folks....!!!!
Today I am giving you a DIY (Do It Yourself) task. Try this in your editor and try to code it as simple as possible. Make use of functions (both built-in and user-defined ones) and all the topics posted till now.
DIY 1: Mini ATM
Today I am giving you a DIY (Do It Yourself) task. Try this in your editor and try to code it as simple as possible. Make use of functions (both built-in and user-defined ones) and all the topics posted till now.
DIY 1: Mini ATM
- Maintain each customer's user-id and account number in a record.
- Maintain a record for each user-id and passwords.
- Maintain a record for availability of amount in ATM. Keep track of each value in the denomination. The denomination order is 2000,500,200,100,50,20,10.
- If the requested amount is invalid ( coins requested ) print error message and terminate.
- Provide provisions for new registration if he/she does not have a valid user-id and password.
- If the user-id and password is valid, Provide the following functionalities:
a. Withdraw
b. Deposit
- Keep track of availability of the amount in the ATM. Records must be maintained for each value in the denomination.
Withdraw:
- Once logged in get the account number from the user and check the balance.
- If the requested amount is less than the balance, go to next step. Otherwise print the error message and terminate.
- If account has requested amount, Check availability of amount in ATM.
- Print out the optimal denomination which means if the user requests rs.2500, it should give a 2000 rupee note and a 500 rupee note on availability. Should not randomly give 5 '500.00' notes.
Deposit:
- Get the account number
- Get the denomination of amount to be deposited and add the sum to the existing one.
- **HINT : Do this is a optimal way , get inputs until the amount is reached.
Try to complete this within 2 days. On Monday I will post some hints and clues to do this one. Take help from that if you cannot model this problem. If you have any queries leave it in the comment section so that I can help you out.
In upcoming DIYs, let us add more functionalities to this, to make it a real-time working project.
Hope you guys would enjoy coding real-time scenarios.....!!!!
Comments
Post a Comment