Program Freezing - miss worded code?

Hey Everyone, I have finally written code that when I run it I have no errors and DeBug actually works! But now the program gets hung up and doesn't do what I instruct it to. I am new to all this so for me to even get code that works I was so excited. But now I can't see where in my code I went wrong, probably because if have been at it for days... Can you see what I am missing??

*Note* I haven't finished writing the savings part I have having trouble when it asks four Withdraw -Deposit. Withdraw doesn't do the right math and then just stops without prompting to ask if you want another transaction and 'd' for deposit just freezes

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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
#include <iostream>
#include <windows.h>

using std::cout;
using std:: cin;
using std:: endl;

using namespace std;




class BankAccount

{
public:
	BankAccount(void); // Base Class
	int getAccountNum(void);
	double getAccountBalance(void);// return balance
	void depositMoney(double depositAmount);// Deposit money
	bool withdrawMoney(double withdrawAmount); // Withdraw money
	void setAccountNum(int newAccountNum);// Set up account
	int newAccountNum;
	double accountBalance;


protected:
	int accountNum;


};
//////////////////////////////////////////////////////////////////////
class CheckingAccount :public BankAccount
{
public:
	CheckingAccount(void);  
	bool withdrawMoney(double);

private:
	int transactionCount;
};
//////////////////////////////////////////////////////
class SavingsAccount : public BankAccount
{
public:
	SavingsAccount(void);

	double getAccountBalance(void);
	void SetInterestRate(double); // set daily interest rate

private:
	double InterestRate; // daily interest
	int numberofDays; // Days since last transaction
	double earnedInterest;// Interest since last transtion

public:
	double getInterestEarned(void); // earned interest
	int getNumberofDays(void);
	int getAccountBalance(double);
};
//////////////////////////////////////////////////////////////

BankAccount::BankAccount(void)
{
	accountNum = 0;
	accountBalance = 0.0;
}

void BankAccount::setAccountNum (int newAccountNum) 
{
	accountNum= newAccountNum;
}

int BankAccount::getAccountNum(void)
{
	return accountNum;
}

double BankAccount::getAccountBalance(void)
{
	return accountBalance;
}

void BankAccount::depositMoney(double depositAmount)
{
	accountBalance = depositAmount + accountBalance;
}
bool BankAccount::withdrawMoney(double withdrawAmount)
{
	if 
		(accountBalance - withdrawAmount < 0)
		return false;

	else
	{
		accountBalance = withdrawAmount- accountBalance;
		return true;
	}
}

//////////////////////////////////////////////////////////////
CheckingAccount ::CheckingAccount (void)
{
	accountBalance =100.00;
}

/////////////////////////////////////////////////////////////////////
SavingsAccount :: SavingsAccount (void)
{
	accountBalance= 100.00;
}

double SavingsAccount::getAccountBalance()
{    
	numberofDays = rand()%7;
	earnedInterest = accountBalance * (numberofDays * InterestRate/(100*365));
	return accountBalance+ earnedInterest;
}
void SavingsAccount::SetInterestRate(double newInterestRate)
{
	InterestRate = newInterestRate;
}
double SavingsAccount::getInterestEarned(void)
{
	return earnedInterest;
}
int SavingsAccount::getNumberofDays(void)
{
	return numberofDays;
}

bool CheckingAccount::withdrawMoney( double withdrawAmount)
{
	transactionCount++;
	if (transactionCount >3)

	{
		if 
			(accountBalance - withdrawAmount - 0.5 < 0)
			cout << "insuficent Funds";
		return false;
		while

			(accountBalance = withdrawAmount + 0.5);

		cout << "Fifty cent fee included for more than three transactions";
		cout << endl;
		return true;
	}

	if (accountBalance-withdrawAmount <0)
		return false;
	while
		(accountBalance = accountBalance - withdrawAmount);
	return true;
}


////////////////////////////////////////////////////////////////////////////////



void main(void)
{
	char Choice;


	int newAccountNum;
	double depositAmount;
	double withdrawAmount;
	double newInterestRate= 0;
	int transactionCount=0;
	int randNumber;

	randNumber = rand();
	srand(GetTickCount());

	BankAccount accountBank;
	CheckingAccount accountChecking;
	SavingsAccount accountSavings;



	cout << "Enter a five digit number to create your checking account number ";
	cin >> newAccountNum;


	cout << "A new checking account was created.";
	cout << endl;
	cout << "Your Checking account Balance is $" << accountChecking.getAccountBalance();
	cout << endl << endl;
	cout<< "Would you like to make a Withdraw or Deposit?"<< "Enter 'W' for withdraw or 'D' for deposit";

	cin >> Choice;
	do
	{

	if (Choice == 'W'|| Choice == 'w' )
		

			cout<< "How much would you like to withdraw?";

			cin >> withdrawAmount;


			cout << "You withdrew:   " << withdrawAmount << "Dollars";
			cout<< endl;


			cout << "New Checking account balance  is $" << accountChecking.withdrawMoney(withdrawAmount);
			cout  << endl ;
			cout << endl;
		

		cout << "Would you like another withdraw transaction?" << "Enter 'Y' for yes and 'N' for no" ;
		cin >> Choice;




	 (Choice='D' || Choice == 'd');


		cout<< "How much would you like to Deposit?";
		cin >> depositAmount;
		cout<< "Your new Account Balance is:   "; accountChecking.depositMoney( depositAmount);
		cout << endl;


		cout << "Would you like another withdraw transaction?" << "Enter 'Y' for yes and 'N' for no" ;
		cin >> Choice;


		if

			(Choice== 'Y' || Choice== 'y')
			cout<< "Would you like to make a Withdraw or Deposit?"<< "Enter 'W' for withdraw or 'D' for deposit";

		cin >> Choice;
	}
		
		while (Choice == 'n' ||Choice =='N');

		cout << "Lets set up an Account Number for your Savings Account!";
		cout<< endl;

		cout << "Enter a five digit Number for a new savings account : ";
		cin >> newAccountNum;

		cout << "A savings account has been created";
		cout  << endl;
		cout << "The new account number is: " << accountSavings.getAccountNum();
		cout << endl;

		cout << "Total interest earned: ";
		cout << accountSavings.getInterestEarned();
		cout << " over " ;
		cout << accountSavings.getNumberofDays();
		cout << " days" ;
		cout << endl;

		cout << "Savings account balance is $" << accountSavings.getAccountBalance();
		cout << endl;

		cout << "Total interest earned: " << accountSavings.getInterestEarned() << " over" << accountSavings.getNumberofDays() << " days";
		cout << endl;
		cout<< endl;


		exit (0);
	}




foo.cpp: In member function ‘bool CheckingAccount::withdrawMoney(double)’:
foo.cpp:144:39: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
foo.cpp:154:38: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
foo.cpp: At global scope:
foo.cpp:163:15: error: ‘::main’ must return ‘int’


142
143
144
		while

			(accountBalance = withdrawAmount + 0.5);
If you want to compare values, then use == (edit: comparing floating points with equal is a bad idea, use a tolerance)
However, you've got a semicolon as the loop body, so the condition will never change.
Last edited on
Okay I didn't get those errors when I ran mine but I fixed that.... So now no matter what I withdraw my account balance is always 1 dollar??
When it asks me if I would like to do another transaction if I hit yes it asks me how much I would like to deposit and i'm in withdraw?

Also when I deposit my account balance is blank??

when I hit no it just asks me that question again....
then if I type in d for deposit transaction at this point it asks me to set up an account number for my savings... I have to have things out of order or not worded right

I have to have things worded wrong but I am missing where.....

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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275

#include <iostream>
#include <windows.h>

using std::cout;
using std:: cin;
using std:: endl;

using namespace std;




class BankAccount

{
public:
	BankAccount(void); // Base Class
	int getAccountNum(void);
	double getAccountBalance(void);// return balance
	void depositMoney(double depositAmount);// Deposit money
	bool withdrawMoney(double withdrawAmount); // Withdraw money
	void setAccountNum(int newAccountNum);// Set up account
	int newAccountNum;
	double accountBalance;


protected:
	int accountNum;


};
//////////////////////////////////////////////////////////////////////
class CheckingAccount :public BankAccount
{
public:
	CheckingAccount(void);  
	bool withdrawMoney(double);

private:
	int transactionCount;
};
//////////////////////////////////////////////////////
class SavingsAccount : public BankAccount
{
public:
	SavingsAccount(void);

	double getAccountBalance(void);
	void SetInterestRate(double); // set daily interest rate

private:
	double InterestRate; // daily interest
	int numberofDays; // Days since last transaction
	double earnedInterest;// Interest since last transtion

public:
	double getInterestEarned(void); // earned interest
	int getNumberofDays(void);
	int getAccountBalance(double);
};
//////////////////////////////////////////////////////////////

BankAccount::BankAccount(void)
{
	accountNum = 0;
	accountBalance = 0.0;
}

void BankAccount::setAccountNum (int newAccountNum) 
{
	accountNum= newAccountNum;
}

int BankAccount::getAccountNum(void)
{
	return accountNum;
}

double BankAccount::getAccountBalance(void)
{
	return accountBalance;
}

void BankAccount::depositMoney(double depositAmount)
{
	accountBalance= depositAmount + accountBalance;
}
bool BankAccount::withdrawMoney(double withdrawAmount)
{
	if 
		(accountBalance - withdrawAmount < 0)
		return false;

	else
	{
		(accountBalance == withdrawAmount- accountBalance);
		return true;
	}
}

//////////////////////////////////////////////////////////////
CheckingAccount ::CheckingAccount (void)
{
	accountBalance =100.00;
}

/////////////////////////////////////////////////////////////////////
SavingsAccount :: SavingsAccount (void)
{
	accountBalance= 100.00;
}

double SavingsAccount::getAccountBalance()
{    
	numberofDays = rand()%7;
	earnedInterest = accountBalance * (numberofDays * InterestRate/(100*365));
	return accountBalance+ earnedInterest;
}
void SavingsAccount::SetInterestRate(double newInterestRate)
{
	InterestRate = newInterestRate;
}
double SavingsAccount::getInterestEarned(void)
{
	return earnedInterest;
}
int SavingsAccount::getNumberofDays(void)
{
	return numberofDays;
}

bool CheckingAccount::withdrawMoney( double withdrawAmount)
{
	transactionCount++;
	if (transactionCount >3)

	{
		if 
			(accountBalance - withdrawAmount - 0.5 < 0)
			cout << "insuficent Funds";
		return false;
		while

			(accountBalance == withdrawAmount + 0.5)

		cout << "Fifty cent fee included for more than three transactions";
		cout << endl;
		return true;
	}

	if (accountBalance-withdrawAmount <0)
		return false;
	else
		(accountBalance == accountBalance - withdrawAmount);
	return true;
}


////////////////////////////////////////////////////////////////////////////////



void main(void)
{
	char Choice;


	int newAccountNum;
	double depositAmount;
	double withdrawAmount;
	double newInterestRate= 0;
	int transactionCount=0;
	int randNumber;

	randNumber = rand();
	srand(GetTickCount());

	BankAccount accountBank;
	CheckingAccount accountChecking;
	SavingsAccount accountSavings;



	cout << "Enter a five digit number to create your checking account number ";
	cin >> newAccountNum;


	cout << "A new checking account was created.";
	cout << endl;
	cout << "Your Checking account Balance is $" << accountChecking.getAccountBalance();
	cout << endl << endl;
	cout<< "Would you like to make a Withdraw or Deposit?"<< "Enter 'W' for withdraw or 'D' for deposit";

	cin >> Choice;
	do
	{

	if (Choice == 'W'|| Choice == 'w' )
	{

			cout<< "How much would you like to withdraw?";

			cin >> withdrawAmount;
			


			cout << "New Checking account balance  is $" << accountChecking.withdrawMoney(withdrawAmount);
			cout<< endl;
			
		

		cout << "Would you like another withdraw transaction?" << "Enter 'Y' for yes and 'N' for no" ;
		cin >> Choice;
	
	
	}
	else if (Choice='D' || Choice == 'd')
	 
	{

		cout<< "How much would you like to Deposit?";
		cin >> depositAmount;
		cout<< "Your new Account Balance is:   "; accountChecking.depositMoney( depositAmount);
		cout << endl;


		cout << "Would you like to make another Depsosit";
			cout << "Enter 'Y' for yes and 'N' for no" ;
		cin >> Choice;
}
	}
		while

			(Choice== 'Y' || Choice== 'y');
			cout<< "Would you like to make a Withdraw or Deposit?"<< "Enter 'W' for withdraw or 'D' for deposit";

		cin >> Choice;
	

		if (Choice == 'n' ||Choice =='N')


		cout << "Lets set up an Account Number for your Savings Account!";
		cout<< endl;

		cout << "Enter a five digit Number for a new savings account : ";
		cin >> newAccountNum;

		cout << "A savings account has been created";
		cout  << endl;
		cout << "The new account number is: " << accountSavings.getAccountNum();
		cout << endl;

		cout << "Total interest earned: ";
		cout << accountSavings.getInterestEarned();
		cout << " over " ;
		cout << accountSavings.getNumberofDays();
		cout << " days" ;
		cout << endl;

		cout << "Savings account balance is $" << accountSavings.getAccountBalance();
		cout << endl;

		cout << "Total interest earned: " << accountSavings.getInterestEarned() << " over" << accountSavings.getNumberofDays() << " days";
		cout << endl;
		cout<< endl;

		
		exit (0);
	}



> Okay I didn't get those errors when I ran mine
You need to enable warnings.
And get a better compiler, main must return int.

> So now no matter what I withdraw my account balance is always 1 dollar??
There is none assignment in the {Bank,CheckingAccount}::withdrawMoney() functions

> When it asks me if I would like to do another transaction
> if I hit yes it asks me how much I would like to deposit and i'm in withdraw?
line 218 else if (Choice='D' || Choice == 'd') you've got assignment instead of comparison.

However the logic of the loop is weird, You ask if you I want to perform another operation, and write my answer on `Choice' ¿how do you figure out which operation I want to perform?

179
180
181
	BankAccount accountBank;
	CheckingAccount accountChecking;
	SavingsAccount accountSavings;
¿you do realize that those are three different objects that have no relationship between them?

> then if I type in d for deposit transaction at this point it asks me to set up an account number
> for my savings... I have to have things out of order or not worded right
Try to follow your code.


By the way, you do have a lot of whitespace (and your indentation is off)
for line
179
180
181
if I don't have that in there I get all these error messages and it doesn't go to any of the class accounts... could this be part of why my math isn't coming out right??

I did the else if... but they skip over and just ignore the 'w' 'd' so if I do 'w' first when I prompt to 'd' second it just skips right to savings??

I removed a lot of the white space but some of it is there so I can read what I am doing b/c I am new at this I was afraid of getting lost, kind of like I am right now... I did the auto format in my visual basic, but I'll try it again....


P.S... I really appreciate all your help right now....
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283

#include <iostream>
#include <windows.h>

using std::cout;
using std:: cin;
using std:: endl;
using namespace std;

class BankAccount

{
public:
	BankAccount(void); // Base Class
	int getAccountNum(void);
	double getAccountBalance(void);// return balance
	void depositMoney(double depositAmount);// Deposit money
	bool withdrawMoney(double withdrawAmount); // Withdraw money
	void setAccountNum(int newAccountNum);// Set up account
	int newAccountNum;
	double accountBalance;


protected:
	int accountNum;


};
//////////////////////////////////////////////////////////////////////
class CheckingAccount :public BankAccount
{
public:
	CheckingAccount(void);
	bool withdrawMoney(double);

private:
	int transactionCount;
};
//////////////////////////////////////////////////////
class SavingsAccount : public BankAccount
{
public:
	SavingsAccount(void);

	double getAccountBalance(void);
	void SetInterestRate(double); // set daily interest rate

private:
	double InterestRate; // daily interest
	int numberofDays; // Days since last transaction
	double earnedInterest;// Interest since last transtion

public:
	double getInterestEarned(void); // earned interest
	int getNumberofDays(void);
	int getAccountBalance(double);
};
//////////////////////////////////////////////////////////////

BankAccount::BankAccount(void)
{
	accountNum = 0;
	accountBalance = 0.0;
}

void BankAccount::setAccountNum (int newAccountNum)
{
	accountNum= newAccountNum;
}

int BankAccount::getAccountNum(void)
{
	return accountNum;
}

double BankAccount::getAccountBalance(void)
{
	return accountBalance;
}

void BankAccount::depositMoney(double depositAmount)
{
	accountBalance= depositAmount + accountBalance;
}
bool BankAccount::withdrawMoney(double withdrawAmount)
{
	if
		(accountBalance - withdrawAmount < 0)
		return false;

	else
	{
		(accountBalance == withdrawAmount- accountBalance);
		return true;
	}
}

//////////////////////////////////////////////////////////////
CheckingAccount ::CheckingAccount (void)
{
	accountBalance =100.00;
}

/////////////////////////////////////////////////////////////////////
SavingsAccount :: SavingsAccount (void)
{
	accountBalance= 100.00;
}

double SavingsAccount::getAccountBalance()
{
	numberofDays = rand()%7;
	earnedInterest = accountBalance * (numberofDays * InterestRate/(100*365));
	return accountBalance+ earnedInterest;
}
void SavingsAccount::SetInterestRate(double newInterestRate)
{
	InterestRate = newInterestRate;
}
double SavingsAccount::getInterestEarned(void)
{
	return earnedInterest;
}
int SavingsAccount::getNumberofDays(void)
{
	return numberofDays;
}

bool CheckingAccount::withdrawMoney( double withdrawAmount)
{
	transactionCount++;
	if (transactionCount >3)

	{
		if
			(accountBalance - withdrawAmount - 0.5 < 0)
			cout << "insuficent Funds";
		return false;

		while
			(accountBalance == withdrawAmount + 0.5)

			cout << "Fifty cent fee included for more than three transactions";
		cout << endl;
		return true;
	}

	if (accountBalance-withdrawAmount <0)
		return false;
	else
		(accountBalance == accountBalance - withdrawAmount);
	return true;
}

////////////////////////////////////////////////////////////////////////////////

void main(void)
{
	char Choice;
	int newAccountNum;
	double depositAmount;
	double withdrawAmount;
	double newInterestRate= 0;
	int transactionCount=0;
	int randNumber;

	randNumber = rand();
	srand(GetTickCount());

	BankAccount accountBank;
	CheckingAccount accountChecking;
	SavingsAccount accountSavings;


	cout<< "Welcome!"<< "Let's start by creating your Checking account";
	cout << "Enter a five digit number to create your checking account number ";
	cin >> newAccountNum;

	cout << "A new checking account was created.";
	cout << endl;

	cout << "Your Checking account Balance is $" << accountChecking.getAccountBalance();
	cout << endl << endl;

	cout<< "Would you like to make a Withdraw or Deposit?"<< "Enter 'W' for withdraw or 'D' for deposit";
	cin >> Choice;
	do
	{

		if (Choice == 'W'|| Choice == 'w' )
		{

			cout<< "How much would you like to withdraw?";
			cin >> withdrawAmount;

			cout << "New Checking account balance  is $" << accountChecking.withdrawMoney(withdrawAmount);
			cout<< endl;
			cout <<"What would you like to do now?" << "Enter 'D' for deposit and 'W' for Withdrawal or 'S' to set up Savings Account" ;
						cin >> Choice;

		}
		else if (Choice='D' || Choice == 'd')
		{
			cout<< "How much would you like to Deposit?";
			cin >> depositAmount;

			cout<< "Your new Account Balance is:   "; accountChecking.depositMoney( depositAmount);
			cout << endl;

			cout << "Would you like to make another Transaction";
			cout << "Enter 'D' for Deposit and 'W' for Withdrawal or 'S' to create a Savings Account" ;
			cin >> Choice;
			
		}
	}
while (Choice == 'S' || Choice == 's');
		{
				cout << "Lets set up an Account Number for your Savings Account!";
				cout<< endl;

				cout << "Enter a five digit Number for a new savings account : ";
				cin >> newAccountNum;

				cout << "A savings account has been created";
				cout  << endl;


				cout << "Total interest earned: ";
				cout << accountSavings.getInterestEarned();
				cout << " over " ;
				cout << accountSavings.getNumberofDays();
				cout << " days" ;
				cout << endl;

				cout << "Savings account balance is $" << accountSavings.getAccountBalance();
				cout << endl;

				cout << "Total interest earned: " << accountSavings.getInterestEarned() << " over" << accountSavings.getNumberofDays() << " days";
				cout << endl;
				cout<< endl;

				cout <<"What would you like to do now?" << "Enter 'D' for deposit and 'W' for Withdrawal or 'E' to Exit" ;
						cin >> Choice;
		}
				if (Choice == 'W'|| Choice == 'w' )
					{

						cout<< "How much would you like to withdraw?";
						cin >> withdrawAmount;

						cout << "New Checking account balance  is $" << accountSavings.withdrawMoney(withdrawAmount);
						cout<< endl;
						cout <<"What would you like to do now?" << "Enter 'D' for deposit and 'W' for Withdrawal or 'E' to Exit" ;
						cin >> Choice;
						

					}
				else if (Choice=='D' || Choice == 'd')

					{

						cout<< "How much would you like to Deposit?";
						cin >> depositAmount;

						cout<< "Your new Account Balance is:   "; accountSavings.depositMoney( depositAmount);
						cout << endl;
						cout <<"What would you like to do now?" << "Enter 'D' for deposit and 'W' for Withdrawal or 'E' to Exit" ;
						cin >> Choice;
						
					}
					
					 while (Choice== 'E' || Choice== 'e');
					 {
					
						cout<< "have a nice day... Good Bye " ;
					 }

						exit(0);

		}
		



..... That's what it did when I reformatted it???







Last edited on
Topic archived. No new replies allowed.