I am writing an atm program for a class and will enclose the instructions. I really want to just write a section of code and make sure I am doing it right before I move on. I am starting with the main menu and was wanting to know if someone could look at the instructions and make sure I did this correctly...
assumptions
1 - only direct account transactions will be done on this ATM
2 - assume this ATM is a bank ATM, no transaction fees
3 - this application will be a 'dos' application
4 - app should be able to cancel at any point via back (goes to main menu, screen 4 and beyond) or exit atm (screens 2 & 3)
5 - max 3 times to log in, after 3 times = show message "your account has been locked."
6 - this is a swipe machine
7 - every screen will have a feedback line on line 1
8 - Can only hold 10,000 dollars before ATM out of order (effects withdrawls, deposits and maintenance screen)
9 - Any withdrawl has to be in $20 amounts, transfers don't have this limitation
10 - Account files will be prepopulated
11 - User can only withdrawl $300 amount per day
12 - Every transaction has a date/time stamp, account #
/* 13 - Information only on screen, or printed/receipts */
Welcome Screen (screen 1)
"hit enter to simulate inserting card"
Data Entry Screen (screen 2)
1) account pin: (resides in a file)
2) exit ATM
-if valid got to main menu
-else, display "invalid account # and/or pin#"
Main Menu Screen (screen 3)
1) withdrawl
2) deposit
3) check balance
4) funds transfer
5) exit ATM
Withdrawl Screen (screen 4.a)
1) from checking
2) from savings
3) quick cash /* optional */
4) back to main menu
Deposit Screen (screen 4.b)
1) to checking
2) to savings
3) back to main menu
Check Balance Screen (screen 4.c)
1) from checking
2) from savings
3) back to main menu
Funds Transfer Screen (screen 4.d)
1) from savings to checking
2) from checking to savings
3) back to main menu
Enter Amount Screen (screen 5.a)
1) Enter Amount
2) back to main menu
/* Quick Cash Amount Screen (screen 5.b)
1) $20.00
2) $40.00
3) $60.00
4) $80.00
5) $100.00
6) back to main menu */
Would you like to perform another transaction (screen 6)
-if yes, go back to screen 2
-else, go to screen 7
Goodbye Screen (screen 7)
display goodbye message, wait 10 seconds, cycle back to welcome screen
/* optional
Maintenance Screen (screen 8)
requires a special pin
1) update money supply
2) exit ATM */
here is my code...
//Class: C++ 230
//Date: 2/16/10
#include <iostream>
using namespace std;
//Function prototypes
void showMenu();
int main ()
{
//Declare variables
int choice;
//Set the numeric output formatting
//cout << fixed << showpoint << setprecision(2);
do
{
//Display the menu and get the user's choice.
showMenu();
cin >> choice;
//Validate the menu selection.
while (choice < 1 || choice > 5)
{
cout << "Please enter 1, 2, 3, 4, or 5: ";
cin >> choice;
}
}
return 0;
}
void showMenu()
{
//Display the main menu screen
cout << endl << "\t\tMain Menu Screen" << endl << endl;
cout << "1) Withdrawal" << endl;
cout << "2) Deposit" << endl;
cout << "3) Check Balance" << endl;
cout << "4) Funds Transfer" << endl;
cout << "5) Exit ATM" << endl << endl;
cout << "Enter your choice: ";
}