Main
Start Menu
1 Create Account
2 Access Account
3 Quit
1 Create Account
Prompt for userName
We assign a unique random number for account and store the unique accountNumber somewhere and make sure it's not a collision
We store a balance of 0.00 and save it
Go back to Start Menu
2 Access Account
Prompt their userName, and accountNumber
If correct, we show the Account Menu
If false, go back to Start Menu
3 Account Menu
1 Read Balance
2 Update Balance
3 Delete Account
4 Go back to Start Menu
1 Read Balance
Spit out balance
Go back to Account Menu
2 Update Balance
Enter amount to update balance (use negative if deduction)
User enters amount, if bad we reprompt an amount
We spit out new balance
Go back to Account Menu
3 Delete Account
Ask user if they are sure
Yes, delete account
No, go back to account menu
int main()
{
int startMenuChoice = 0;
//Create start menu loop
//Print out menu and wait for user input
do
{
cout << "Start Menu\n";
cout << "1 Create Account\n";
cout << "2 Access Account\n";
cout << "3 Quit\n";
cout << "Please choose one of the options: ";
cin >> startMenuChoice;
This is an assignment that I am doing. The overview of what I want the program to do is at the top and the bottom is what I have so far.
What I need to add:
1. Add arrays to program to handle more data.
2. Create a hierarchy chart showing the logical components of the program. Modularize the code according to chart. Menu should call individual modules to do the work of the program.
3. Add the ability to save data to disk in one or more files. The menu(s) should give the user the option to save or retrieve data.
struct bankAccount {
int balance;
string acctNumber;
string userName;
};
bankAccount myAccount; // you now have one account
cin myAccount.userName;
mikeycc wrote:
I need to incorporate arrays.
Then arrays of those related things.
1 2
bankAccount myAccounts[100]; // you now have one hundred accounts
cin myAccounts[0].userName;
The point of this is to show you that you can easily evolve the s/w through a number of steps.
The trick is to not look at your assignment and panic at not being able to write the whole thing in a single keyboard session.
It begins on paper, where you sketch out ideas for intermediate steps that get you to your goal.
A good place to start would be a single account without an account number.