x.Hmost of my errors fixed up but just have a couple additional problems. Whenev
ID: 3616878 • Letter: X
Question
x.Hmost of my errors fixed up but just have a couple additional problems. Whenever I hit the choice to go back to main menu it goes to the withdraw menu. I apologize as this may sound confusing but if you could just run my code you will see what I mean. The same is true from the last function of my code...- //Class: C++ 230
- //Date: 2/16/10
- //Assignment: final
- #include <iostream>
- #include <iomanip>
- using namespace std;
- //Function prototypes
- void showMenu();
- int mainMenuSelection(int);
- void welcomeScreen();
- double enterAmountScreen(double);
- int main ()
- {
- //Declare variables
- int choice;
- //Set the numeric output formatting
- cout << fixed << showpoint << setprecision(2);
- //Function for welcome screen
- welcomeScreen();
- //Create a dowhile loop
- 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;
- }
- //Function to choose in the main menu selection
- mainMenuSelection(choice);
- } while (choice != 5);
- return 0;
- }
- //Function to show the main menu
- void showMenu()
- {
- //Display the main menu screen
- cout << endl << " Main 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: ";
- }
- //Function to choose in the main menu screen
- int mainMenuSelection(int choice)
- {
- //Declare variables in mainMenuSelection
- int withdrawChoice,
- depositChoice,
- checkBalanceChoice,
- fundsTransferChoice;
- double money = 0.0;
- //Respond to user's menu selection
- switch (choice)
- {
- case 1:
- do
- {
- cout <<" Withdrawal Screen" << endl << endl;
- cout << "1) From Checking" << endl;
- cout << "2) From Savings" << endl;
- cout << "3) Quick Cash" << endl;
- cout << "4) Back to Main Menu" << endl;
- cout << "Enter your withdraw choice: ";
- cin >> withdrawChoice;
- while (withdrawChoice < 1 || withdrawChoice > 4)
- {
- cout << "Please reenter 1, 2, 3, 4: ";
- cin >> withdrawChoice;
- }
- enterAmountScreen(money);
- } while (choice != 4);
- //Back to main menu option
- if (choice == 4)
- {
- showMenu();
- }
- break;
- case 2:
- do
- {
- cout <<" Deposit Screen" << endl << endl;
- cout << "1) To Checking" << endl;
- cout << "2) To Savings" << endl;
- cout << "3) Back to Main Menu" <<
- //Class: C++ 230
- //Date: 2/16/10
- //Assignment: final
- #include <iostream>
- #include <iomanip>
- using namespace std;
- //Function prototypes
- void showMenu();
- int mainMenuSelection(int);
- void welcomeScreen();
- double enterAmountScreen(double);
- int main ()
- {
- //Declare variables
- int choice;
- //Set the numeric output formatting
- cout << fixed << showpoint << setprecision(2);
- //Function for welcome screen
- welcomeScreen();
- //Create a dowhile loop
- 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;
- }
- //Function to choose in the main menu selection
- mainMenuSelection(choice);
- } while (choice != 5);
- return 0;
- }
- //Function to show the main menu
- void showMenu()
- {
- //Display the main menu screen
- cout << endl << " Main 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: ";
- }
- //Function to choose in the main menu screen
- int mainMenuSelection(int choice)
- {
- //Declare variables in mainMenuSelection
- int withdrawChoice,
- depositChoice,
- checkBalanceChoice,
- fundsTransferChoice;
- double money = 0.0;
- //Respond to user's menu selection
- switch (choice)
- {
- case 1:
- do
- {
- cout <<" Withdrawal Screen" << endl << endl;
- cout << "1) From Checking" << endl;
- cout << "2) From Savings" << endl;
- cout << "3) Quick Cash" << endl;
- cout << "4) Back to Main Menu" << endl;
- cout << "Enter your withdraw choice: ";
- cin >> withdrawChoice;
- while (withdrawChoice < 1 || withdrawChoice > 4)
- {
- cout << "Please reenter 1, 2, 3, 4: ";
- cin >> withdrawChoice;
- }
- enterAmountScreen(money);
- } while (choice != 4);
- //Back to main menu option
- if (choice == 4)
- {
- showMenu();
- }
- break;
- case 2:
- do
- {
- cout <<" Deposit Screen" << endl << endl;
- cout << "1) To Checking" << endl;
- cout << "2) To Savings" << endl;
- cout << "3) Back to Main Menu" <<
- //Class: C++ 230
- //Date: 2/16/10
- //Assignment: final
- #include <iostream>
- #include <iomanip>
- using namespace std;
- //Function prototypes
- void showMenu();
- int mainMenuSelection(int);
- void welcomeScreen();
- double enterAmountScreen(double);
- int main ()
- {
- //Declare variables
- int choice;
- //Set the numeric output formatting
- cout << fixed << showpoint << setprecision(2);
- //Function for welcome screen
- welcomeScreen();
- //Create a dowhile loop
- 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;
- }
- //Function to choose in the main menu selection
- mainMenuSelection(choice);
- } while (choice != 5);
- return 0;
- }
- //Function to show the main menu
- void showMenu()
- {
- //Display the main menu screen
- cout << endl << " Main 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: ";
- }
- //Function to choose in the main menu screen
- int mainMenuSelection(int choice)
- {
- //Declare variables in mainMenuSelection
- int withdrawChoice,
- depositChoice,
- checkBalanceChoice,
- fundsTransferChoice;
- double money = 0.0;
- //Respond to user's menu selection
- switch (choice)
- {
- case 1:
- do
- {
- cout <<" Withdrawal Screen" << endl << endl;
- cout << "1) From Checking" << endl;
- cout << "2) From Savings" << endl;
- cout << "3) Quick Cash" << endl;
- cout << "4) Back to Main Menu" << endl;
- cout << "Enter your withdraw choice: ";
- cin >> withdrawChoice;
- while (withdrawChoice < 1 || withdrawChoice > 4)
- {
- cout << "Please reenter 1, 2, 3, 4: ";
- cin >> withdrawChoice;
- }
- enterAmountScreen(money);
- } while (choice != 4);
- //Back to main menu option
- if (choice == 4)
- {
- showMenu();
- }
- break;
- case 2:
- do
- {
- cout <<" Deposit Screen" << endl << endl;
- cout << "1) To Checking" << endl;
- cout << "2) To Savings" << endl;
- cout << "3) Back to Main Menu" <<
- //Class: C++ 230
- //Date: 2/16/10
- //Assignment: final
- #include <iostream>
- #include <iomanip>
- using namespace std;
- //Function prototypes
- void showMenu();
- int mainMenuSelection(int);
- void welcomeScreen();
- double enterAmountScreen(double);
- int main ()
- {
- //Declare variables
- int choice;
- //Set the numeric output formatting
- cout << fixed << showpoint << setprecision(2);
- //Function for welcome screen
- welcomeScreen();
- //Create a dowhile loop
- 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;
- }
- //Function to choose in the main menu selection
- mainMenuSelection(choice);
- } while (choice != 5);
- return 0;
- }
- //Function to show the main menu
- void showMenu()
- {
- //Display the main menu screen
- cout << endl << " Main 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: ";
- }
- //Function to choose in the main menu screen
- int mainMenuSelection(int choice)
- {
- //Declare variables in mainMenuSelection
- int withdrawChoice,
- depositChoice,
- checkBalanceChoice,
- fundsTransferChoice;
- double money = 0.0;
- //Respond to user's menu selection
- switch (choice)
- {
- case 1:
- do
- {
- cout <<" Withdrawal Screen" << endl << endl;
- cout << "1) From Checking" << endl;
- cout << "2) From Savings" << endl;
- cout << "3) Quick Cash" << endl;
- cout << "4) Back to Main Menu" << endl;
- cout << "Enter your withdraw choice: ";
- cin >> withdrawChoice;
- while (withdrawChoice < 1 || withdrawChoice > 4)
- {
- cout << "Please reenter 1, 2, 3, 4: ";
- cin >> withdrawChoice;
- }
- enterAmountScreen(money);
- } while (choice != 4);
- //Back to main menu option
- if (choice == 4)
- {
- showMenu();
- }
- break;
- case 2:
- do
- {
- cout <<" Deposit Screen" << endl << endl;
- cout << "1) To Checking" << endl;
- cout << "2) To Savings" << endl;
- cout << "3) Back to Main Menu" <<
Explanation / Answer
x.j5lor="red">please rate - thanks now goes back to the Main menu. your balance and transfer code is incomplete. it doesn't ask for the pin anywhere but basically put it in a loop with a counter and if the counter gets to 3 bump them out. what are the max transactions? //Class: C++ 230 //Date: 2/16/10 //Assignment: final #include #include using namespace std; //Function prototypes void showMenu(); int mainMenuSelection(int); void welcomeScreen(); double enterAmountScreen(double); int main () { //Declare variables int choice; //Set the numeric output formatting coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.