-
Ask user to enter the account number they want to add
-
Verify that the account is not in the array - If it is, throw a message saying this account already exists - If account doesn't exist, add it into the array
-
Verify that the account number is valid (between 1000 and 5000) User can enter more than one account number, one at a time - ask the user "do you want to enter another account number?" If user says yes, you will ask for another account. If user says no, exit the adding accounts
- look for an account; called LookupAccounts (in CRUD; lookup)
- Ask user to enter a valid account number and we will print to the user that the account exists or not (that will be the output)
- Ask user if they want to check for other account number (yes/no)
- Ask user for a valid account number
- Verify if the account exists
- If account exists, ask for the new account number
- New account number should be valid and not duplicate
- Ask user if they want to continue updating another account
- Ask user for a valid account number
- Verify if the account exists
- If yes, delete it from the array
- Ask the user if they want to delete another account
- Option 1 - Add
- Option 2 - Lookup/read (showAccounts)
- Option 3 - Update (updateAccounts)
- Option 4 - Delete (remove/delete accounts)
- Option 5 - Exit
- 500
- Keep array sorted in ascending order
- When we insert a value to the array, add the new account to the end of the array (after the last one) and then we sort it
- Whenever we change the array, we sort the array
- If we delete/remove an account, we will replace that account number with 9999 and then we sort the array after
- The array will be initialized (empty) with 9999