ATM machine is not exiting Due thursday

So my project is to include 2 accounts checking and savings that both start at 1000 and can have funds transfer between accounts, funds be withdrawn, and deposited. I'm stuck... the program wont break when trying to return to menu and just selects option 1. let me know if you can help please this project is due thursday!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
  #include <iostream>
#include <iomanip>
using namespace std;
//Function prototypes

void showMenu();
int mainMenuSelection(int);

double enterAmountScreen(double);
int main()
{
	//variables
	int choice;

	//Set the numeric output formatting
	cout << fixed << showpoint << setprecision(2);
	//Function for welcome screen


	//Create a do\while 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 << "\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: ";
}

//Function to choose in the main menu screen
int mainMenuSelection(int choice)
{
	//Declare variables in mainMenuSelection
	int withdrawChoice,
		depositChoice,
		checkBalanceChoice,
		fundsTransferChoice;
	double money = 1000.00;
	//Respond to user's menu selection
	switch (choice)
	{
	case 1:
		do
		{
			cout << "\t\tWithdrawal 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 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)
		{
			break;
		}
		break;
	case 2:
		do
		{
			cout << "\t\tDeposit Screen" << endl << endl;
			cout << "1) To Checking" << endl;
			cout << "2) To Savings" << endl;
			cout << "3) Back to Main Menu" << endl;
			cout << "Enter your deposit choice: ";
			cin >> depositChoice;
			while (depositChoice < 1 || depositChoice > 3)
			{
				cout << "Please reenter 1, 2, or 3: ";
				cin >> depositChoice;
			}
			enterAmountScreen(money);
		} while (choice != 3);
		//Back to main menu option
		if (choice == 3)
		{
			showMenu();
		}
		break;
	case 3:
		do
		{
			cout << "\t\tCheck Balance Screen" << endl << endl;
			cout << "1) From Checking" << endl;
			cout << "2) From Savings" << endl;
			cout << "3) Back to Main Menu" << endl;
			cout << "Enter Your Check Balance Choice: ";
			cin >> checkBalanceChoice;
			while (checkBalanceChoice < 1 || checkBalanceChoice > 3)
			{
				cout << "Please reenter 1, 2, or 3: ";
				cin >> checkBalanceChoice;
			}
		} while (choice != 3);
		//Back to main menu option
		if (choice == 3)
		{
			showMenu();
		}
		break;
	case 4:
		do
		{
			cout << "\t\tFunds Transfer Screen" << endl << endl;
			cout << "1) From Savings to Checking" << endl;
			cout << "2) From Checking to Savings" << endl;
			cout << "3) Back to Main Menu" << endl;
			cout << "Enter Your Funds Transfer Choice: ";
			cin >> fundsTransferChoice;
			while (fundsTransferChoice < 1 || fundsTransferChoice > 3)
			{
				cout << "Please reenter 1, 2, or 3: ";
				cin >> fundsTransferChoice;
			}
			enterAmountScreen(money);
		} while (choice != 3);
		//Back to main menu option
		if (choice == 3)
		{
			showMenu();
		}
		break;
	case 5:
		cout << "Program ending." << endl << endl;
		break;
	}
	return choice;
}

//Function to display the welcome screen

//Function to enter amount screen
double enterAmountScreen(double money)
{
	int decision;

	cout << endl << "\t\tEnter Amount Screen" << endl;
	cout << "1) Enter Amount:";
	cout << endl << "2) Back to Main Menu:";
	cout << endl << "Enter your decision for the amount screen: ";
	cin >> decision;
	if (decision == 2)
	{
		showMenu();
		
	}
	else
	{
		cout << "Please enter the amount: ";
		cin >> money;
	}
	return money;
}


I also do not know where to set my balance for each account to 1000
Last edited on
Topic archived. No new replies allowed.