This program was created to represent the transaction that a bank teller may encounter. This program has only been tested in the google cloud shell editor so please use that. The user is required to login to the program first with a password before anything can be done. Default password is password.
- Head over to https://shell.cloud.google.com/
- Sign in with a Google Account.
- Make sure the terminal and editor are open by pressing these icons
- Create or open a homeworkspace
- Create a new file by going to File > New File. Name the file BankTeller.cpp. Don't forget the .cpp file extension
- Type g++ BankTeller.cpp in the terminal
- Type ./a.out menu in the terminal
- Password is password
- Have fun 😁
The user uses a menu (see image below) to do certain transactions or by using command-line arguments. Available command-line arguments include:
- ./a.out create - to create a new bank account
- ./a.out show - to show all the bank accounts
- ./a.out deposit - for a deposit
- ./a.out withdraw - for a withdraw
- ./a.out fee - to apply a fee
- ./a.out balance - for a balance inquiry
- ./a.out menu - to access the menu
- ./a.out – to see all available command-line arguments
When using the menu, the program will prompt the user to enter a number 1 -7 to access the contents of the menu. For the deposit, withdraw, apply fee and check balance functions, the user is required to enter a valid bank account number else they will be returned to the main menu. To view an account the user can enter 2 to show all the accounts and right-click and copy/paste to make it easier.
- User enters 1 on the menu
- Program checks if accounts.txt and accounts.csv exist
- accounts.txt is read by the program and stores existing created accounts in a vector and adds new ones if they are created.
- accounts.csv stores information associated with the account like the first name, last name, house number and street address, state, zip code which can be opened in Excel or other software for more convenient viewing
- If accounts.txt and account.csv are not created the program automatically creates them
- User enters 2 on the menu
- Displays all the current accounts from accounts.txt in the terminal
- Allows the user to enter deposits for a valid bank account
- User must enter a bank account before entering details of the deposit
- A deposits directory will be automatically created if there is not one already
- A text file associated with that account will be created in that directory with a name like EEGEFLIHJDDeposit.txt if the file does not already exist. If it exists then the new information will be appended.
- Allows the user to enter withdraws for a valid bank account
- User must enter a bank account before entering details of the withdraw
- A withdraws directory will be automatically created if there is not one already
- A text file associated with that account will be created in that directory with a name like EEGEFLIHJDWithdraw.txt if the file does not already exist. If it exists then the new information will be appended.
- Allows the user to apply fees for a valid bank account
- User must enter a bank account before entering details of the fee
- A fees directory will be automatically created if there is not one already
- A text file associated with that account will be created in that directory with a name like EEGEFLIHJDFees.txt if the file does not already exist. If it exists then the new information will be appended.
- Allows the user to check the balance for a valid bank account
- Check balance uses the text files from withdraws, deposits, and fees to calculate the balance of a bank account
- Positive balances are green and negative balances are red
- Balance = deposits – withdraws - fees
- User can enter 7 to exit the program