Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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...


 
  1. //Class: C++ 230
  2. //Date: 2/16/10
  3. //Assignment: final
  4. #include <iostream>
  5. #include <iomanip>
  6. using namespace std;
  7. //Function prototypes
  8. void showMenu();
  9. int mainMenuSelection(int);
  10. void welcomeScreen();
  11. double enterAmountScreen(double);
  12. int main ()
  13. {
  14. //Declare variables
  15. int choice;
  16. //Set the numeric output formatting
  17. cout << fixed << showpoint << setprecision(2);
  18. //Function for welcome screen
  19. welcomeScreen();
  20. //Create a dowhile loop
  21. do
  22. {
  23. //Display the menu and get the user's choice.
  24. showMenu();
  25. cin >> choice;
  26. //Validate the menu selection.
  27. while (choice < 1 || choice > 5)
  28. {
  29. cout << "Please enter 1, 2, 3, 4, or 5: ";
  30. cin >> choice;
  31. }
  32. //Function to choose in the main menu selection
  33. mainMenuSelection(choice);
  34. } while (choice != 5);
  35. return 0;
  36. }
  37. //Function to show the main menu
  38. void showMenu()
  39. {
  40. //Display the main menu screen
  41. cout << endl << " Main Menu Screen" << endl << endl;
  42. cout << "1) Withdrawal" << endl;
  43. cout << "2) Deposit" << endl;
  44. cout << "3) Check Balance" << endl;
  45. cout << "4) Funds Transfer" << endl;
  46. cout << "5) Exit ATM" << endl << endl;
  47. cout << "Enter your choice: ";
  48. }
  49. //Function to choose in the main menu screen
  50. int mainMenuSelection(int choice)
  51. {
  52. //Declare variables in mainMenuSelection
  53. int withdrawChoice,
  54. depositChoice,
  55. checkBalanceChoice,
  56. fundsTransferChoice;
  57. double money = 0.0;
  58. //Respond to user's menu selection
  59. switch (choice)
  60. {
  61. case 1:
  62. do
  63. {
  64. cout <<" Withdrawal Screen" << endl << endl;
  65. cout << "1) From Checking" << endl;
  66. cout << "2) From Savings" << endl;
  67. cout << "3) Quick Cash" << endl;
  68. cout << "4) Back to Main Menu" << endl;
  69. cout << "Enter your withdraw choice: ";
  70. cin >> withdrawChoice;
  71. while (withdrawChoice < 1 || withdrawChoice > 4)
  72. {
  73. cout << "Please reenter 1, 2, 3, 4: ";
  74. cin >> withdrawChoice;
  75. }
  76. enterAmountScreen(money);
  77. } while (choice != 4);
  78. //Back to main menu option
  79. if (choice == 4)
  80. {
  81. showMenu();
  82. }
  83. break;
  84. case 2:
  85. do
  86. {
  87. cout <<" Deposit Screen" << endl << endl;
  88. cout << "1) To Checking" << endl;
  89. cout << "2) To Savings" << endl;
  90. cout << "3) Back to Main Menu" <<
 
  1. //Class: C++ 230
  2. //Date: 2/16/10
  3. //Assignment: final
  4. #include <iostream>
  5. #include <iomanip>
  6. using namespace std;
  7. //Function prototypes
  8. void showMenu();
  9. int mainMenuSelection(int);
  10. void welcomeScreen();
  11. double enterAmountScreen(double);
  12. int main ()
  13. {
  14. //Declare variables
  15. int choice;
  16. //Set the numeric output formatting
  17. cout << fixed << showpoint << setprecision(2);
  18. //Function for welcome screen
  19. welcomeScreen();
  20. //Create a dowhile loop
  21. do
  22. {
  23. //Display the menu and get the user's choice.
  24. showMenu();
  25. cin >> choice;
  26. //Validate the menu selection.
  27. while (choice < 1 || choice > 5)
  28. {
  29. cout << "Please enter 1, 2, 3, 4, or 5: ";
  30. cin >> choice;
  31. }
  32. //Function to choose in the main menu selection
  33. mainMenuSelection(choice);
  34. } while (choice != 5);
  35. return 0;
  36. }
  37. //Function to show the main menu
  38. void showMenu()
  39. {
  40. //Display the main menu screen
  41. cout << endl << " Main Menu Screen" << endl << endl;
  42. cout << "1) Withdrawal" << endl;
  43. cout << "2) Deposit" << endl;
  44. cout << "3) Check Balance" << endl;
  45. cout << "4) Funds Transfer" << endl;
  46. cout << "5) Exit ATM" << endl << endl;
  47. cout << "Enter your choice: ";
  48. }
  49. //Function to choose in the main menu screen
  50. int mainMenuSelection(int choice)
  51. {
  52. //Declare variables in mainMenuSelection
  53. int withdrawChoice,
  54. depositChoice,
  55. checkBalanceChoice,
  56. fundsTransferChoice;
  57. double money = 0.0;
  58. //Respond to user's menu selection
  59. switch (choice)
  60. {
  61. case 1:
  62. do
  63. {
  64. cout <<" Withdrawal Screen" << endl << endl;
  65. cout << "1) From Checking" << endl;
  66. cout << "2) From Savings" << endl;
  67. cout << "3) Quick Cash" << endl;
  68. cout << "4) Back to Main Menu" << endl;
  69. cout << "Enter your withdraw choice: ";
  70. cin >> withdrawChoice;
  71. while (withdrawChoice < 1 || withdrawChoice > 4)
  72. {
  73. cout << "Please reenter 1, 2, 3, 4: ";
  74. cin >> withdrawChoice;
  75. }
  76. enterAmountScreen(money);
  77. } while (choice != 4);
  78. //Back to main menu option
  79. if (choice == 4)
  80. {
  81. showMenu();
  82. }
  83. break;
  84. case 2:
  85. do
  86. {
  87. cout <<" Deposit Screen" << endl << endl;
  88. cout << "1) To Checking" << endl;
  89. cout << "2) To Savings" << endl;
  90. cout << "3) Back to Main Menu" <<
 
  1. //Class: C++ 230
  2. //Date: 2/16/10
  3. //Assignment: final
  4. #include <iostream>
  5. #include <iomanip>
  6. using namespace std;
  7. //Function prototypes
  8. void showMenu();
  9. int mainMenuSelection(int);
  10. void welcomeScreen();
  11. double enterAmountScreen(double);
  12. int main ()
  13. {
  14. //Declare variables
  15. int choice;
  16. //Set the numeric output formatting
  17. cout << fixed << showpoint << setprecision(2);
  18. //Function for welcome screen
  19. welcomeScreen();
  20. //Create a dowhile loop
  21. do
  22. {
  23. //Display the menu and get the user's choice.
  24. showMenu();
  25. cin >> choice;
  26. //Validate the menu selection.
  27. while (choice < 1 || choice > 5)
  28. {
  29. cout << "Please enter 1, 2, 3, 4, or 5: ";
  30. cin >> choice;
  31. }
  32. //Function to choose in the main menu selection
  33. mainMenuSelection(choice);
  34. } while (choice != 5);
  35. return 0;
  36. }
  37. //Function to show the main menu
  38. void showMenu()
  39. {
  40. //Display the main menu screen
  41. cout << endl << " Main Menu Screen" << endl << endl;
  42. cout << "1) Withdrawal" << endl;
  43. cout << "2) Deposit" << endl;
  44. cout << "3) Check Balance" << endl;
  45. cout << "4) Funds Transfer" << endl;
  46. cout << "5) Exit ATM" << endl << endl;
  47. cout << "Enter your choice: ";
  48. }
  49. //Function to choose in the main menu screen
  50. int mainMenuSelection(int choice)
  51. {
  52. //Declare variables in mainMenuSelection
  53. int withdrawChoice,
  54. depositChoice,
  55. checkBalanceChoice,
  56. fundsTransferChoice;
  57. double money = 0.0;
  58. //Respond to user's menu selection
  59. switch (choice)
  60. {
  61. case 1:
  62. do
  63. {
  64. cout <<" Withdrawal Screen" << endl << endl;
  65. cout << "1) From Checking" << endl;
  66. cout << "2) From Savings" << endl;
  67. cout << "3) Quick Cash" << endl;
  68. cout << "4) Back to Main Menu" << endl;
  69. cout << "Enter your withdraw choice: ";
  70. cin >> withdrawChoice;
  71. while (withdrawChoice < 1 || withdrawChoice > 4)
  72. {
  73. cout << "Please reenter 1, 2, 3, 4: ";
  74. cin >> withdrawChoice;
  75. }
  76. enterAmountScreen(money);
  77. } while (choice != 4);
  78. //Back to main menu option
  79. if (choice == 4)
  80. {
  81. showMenu();
  82. }
  83. break;
  84. case 2:
  85. do
  86. {
  87. cout <<" Deposit Screen" << endl << endl;
  88. cout << "1) To Checking" << endl;
  89. cout << "2) To Savings" << endl;
  90. cout << "3) Back to Main Menu" <<
 
  1. //Class: C++ 230
  2. //Date: 2/16/10
  3. //Assignment: final
  4. #include <iostream>
  5. #include <iomanip>
  6. using namespace std;
  7. //Function prototypes
  8. void showMenu();
  9. int mainMenuSelection(int);
  10. void welcomeScreen();
  11. double enterAmountScreen(double);
  12. int main ()
  13. {
  14. //Declare variables
  15. int choice;
  16. //Set the numeric output formatting
  17. cout << fixed << showpoint << setprecision(2);
  18. //Function for welcome screen
  19. welcomeScreen();
  20. //Create a dowhile loop
  21. do
  22. {
  23. //Display the menu and get the user's choice.
  24. showMenu();
  25. cin >> choice;
  26. //Validate the menu selection.
  27. while (choice < 1 || choice > 5)
  28. {
  29. cout << "Please enter 1, 2, 3, 4, or 5: ";
  30. cin >> choice;
  31. }
  32. //Function to choose in the main menu selection
  33. mainMenuSelection(choice);
  34. } while (choice != 5);
  35. return 0;
  36. }
  37. //Function to show the main menu
  38. void showMenu()
  39. {
  40. //Display the main menu screen
  41. cout << endl << " Main Menu Screen" << endl << endl;
  42. cout << "1) Withdrawal" << endl;
  43. cout << "2) Deposit" << endl;
  44. cout << "3) Check Balance" << endl;
  45. cout << "4) Funds Transfer" << endl;
  46. cout << "5) Exit ATM" << endl << endl;
  47. cout << "Enter your choice: ";
  48. }
  49. //Function to choose in the main menu screen
  50. int mainMenuSelection(int choice)
  51. {
  52. //Declare variables in mainMenuSelection
  53. int withdrawChoice,
  54. depositChoice,
  55. checkBalanceChoice,
  56. fundsTransferChoice;
  57. double money = 0.0;
  58. //Respond to user's menu selection
  59. switch (choice)
  60. {
  61. case 1:
  62. do
  63. {
  64. cout <<" Withdrawal Screen" << endl << endl;
  65. cout << "1) From Checking" << endl;
  66. cout << "2) From Savings" << endl;
  67. cout << "3) Quick Cash" << endl;
  68. cout << "4) Back to Main Menu" << endl;
  69. cout << "Enter your withdraw choice: ";
  70. cin >> withdrawChoice;
  71. while (withdrawChoice < 1 || withdrawChoice > 4)
  72. {
  73. cout << "Please reenter 1, 2, 3, 4: ";
  74. cin >> withdrawChoice;
  75. }
  76. enterAmountScreen(money);
  77. } while (choice != 4);
  78. //Back to main menu option
  79. if (choice == 4)
  80. {
  81. showMenu();
  82. }
  83. break;
  84. case 2:
  85. do
  86. {
  87. cout <<" Deposit Screen" << endl << endl;
  88. cout << "1) To Checking" << endl;
  89. cout << "2) To Savings" << endl;
  90. 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 cout