Project zip folder:
Cash-dispensing-application.zipApplication demo video:
Project description:
This is a cash dispensing system providing like an ATM service for the user to add money or withdraw money.
There are only 3 options for the user to choose when using the application, to add notes, to remove notes,
or to exit from the application.
The ATM has an initial amount of $300, there are 4 of the $50 notes and 5 of the $20 notes to make up $500 in total.
If adding or withdrawing notes will affect the current amount of the ATM and change of numbers of the $50 and $20,
the ATM will need to report back the changes in every successful request. It will not change the current amount or
the number of bank notes if a request is invalid or unsuccessful.
This ATM only support $50 notes and $20 notes, the user has to enter a number which is a combination between
$50 and $20. There are a lot of condition checkings to decide whether the ATM will allow the adding notes or
removing notes requests. And there are some returns of error messages to let the user know what has done wrong.
Technology used:
Using Java as the programming language, IntelliJ as the code editor, test the application in the console
Application features:
- Give options to the user whether to add notes, to remove notes, or to exit
- Switch cases between adding notes, remove notes, and exit
- Find combination of $50 and $20
- Validation rule to forbid the user to withdraw more money than the ATM has
- Check whether the ATM has enough numbers of $50 and $20 to proceed a withdrawal request
- Give notification if the current amount is low
There is a while loop for the user to choose which operation wanting to perform, the user needs to enter a number which represent the option to perform. It will keep asking the user until the exit option is chosen.
Depending on the option chosen, to decide what the ATM will do next. It will have a lot of condition checkings to decide whether the user's request is valid and finish the operation successfully.
The ATM only support $50 and $20, so if the user entered numbers like 10 or 30, it will return an error message saying "This ATM only support $50 and $20". If the user enter a number if is not valid, the ATM will keep asking for another number until it is valid. If a number can be (first divided by 50, then the rest amount divided by 20) or (divided by 50) or (divided by 20), this is deemed as a valid number, the ATM will add the amount to the ATM, then calculate the current amount and change of numbers of $50 and $20.
If the remove notes amount is greater than the current amount, it will return an error message to the user.
If the user entered a number that is less than the current amount, and the number is a valid combination of 50 and 20, the application will check whether the ATM has enough $50 notes and $20 notes to proceed the withdrawal request. A valid combination of 50 and 20 by Maths does not mean the ATM has enough combination of $50 notes and $20 notes to perform the request.
If the ATM has enough bank notes to proceed the request, it will calculate the current amount after the money is removed and how many $50 notes and $20 notes left in the ATM, otherwise it will return an error message to the user saying "You don't have enough $50 and $20 to proceed the request."
If the current amount is less than $100, the application will remind the user to top up some money.