Issue with class constructors

EDIT:I'm not asking anyone to reformat, fix or harp on the way I wrote it. I am a beginner. I'm getting this error code a few time in the compiler. Is there someone brave enough to try and find me a reason. Again big thanks...THANKS

1>c:\users\adm1\documents\visual studio 2010\projects\comp220 w3 ilab\comp220 w3 ilab\bankingaccount.h(46): error C2064: term does not evaluate to a function taking 1 arguments

EDIT2:
This error code shows up 6 times for bankingAccount.h, lines 44 and 46 of the first post for that file.


So, I have this assignment for class. And I am having issue understanding the concept with constructors, and how to syntax it correctly. I have come up with a dozen incorrect ways, but that will never complete the code. Would someone be so kind as to formulate an example explaining the correct syntax? I cannot seem to find an example/explanation that is clear to me. I understand that a constructor has to have the same name as the class it is assigned to. I guess my real problem is how to inherit the initialized elements within the constructors and how to use them in a derived class. There it is. Thanks

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
// Here is the base class file.

 #ifndef BANKINGACCOUNT_H
#define BANKINGACCOUNT_H

#include <iostream>
#include <string>
#include <iomanip>
#include <ctime>

using namespace std;

class bankingAccount
	{
	private:
		
		string firstName;
		string lastName;
		float temp;
		int SAnumber;
		int CAnumber;
		int tran;
		float fee;
		
	
	public:
		void acctInfoUpdate();
		void acctInfo();
		float CAtotal;
		float SAtotal;
		void withdrawl();
		void deposit();
		void insufficent();
		int acct;
		float recTranSW[101];
		float recTranCW[101];
		float recTranCD[101];
		float recTranSD[101];
		void CDtran();
		void SDtran();
		void CWtran();
		void SWtran();
		bankingAccount(float CAtotal,         // Is this correct??
			float SAtotal){CAtotal(CAtotal); 
			SAtotal(SAtotal);} // How am I able to call this in
	};                                 // a derived class??

#endif 


Again, thanks!
Last edited on
Hi!
I'm a student also, so I'm not sure this is correct, but I believe your constructor should use different names for the parameters than your variables' name, like this. You can obviously use any name you want.

bankingAccount(float x, int y){CAtotal(x); SAtotal(y);}
Okay thank you for the response. I did change that, and added the elements to the public list. I'm gonna post the error codes and the rest of my program. I know I got a bunch of work still to do, just bear with me please. I thank you for any help offered.

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
// here is a derived class
#ifndef SAVINGSACCOUNT_H
#define SAVINGSACCOUNT_H

#include <iostream>
#include <string>
#include <ctime>
#include <iomanip>
#include "bankingAccount.h"

using namespace std;


class SavingsAccount : public bankingAccount
{
private:
	float daily;
	float yearly;
	int random;
	int tran;
	float fee;
	float temp1;
	float temp2;

public:
	void feeS();
	void interest(float, float);
	void lastTrans(int);
	void inquiry(int);
	void transactionsS();
	void tranS();
	SavingsAccount();

};

#endif 
and another derived class
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
#ifndef CHECKINGACCOUNT_H
#define CHECKINGACCOUNT_H

#include <iostream>
#include <string>
#include <ctime>
#include "bankingAccount.h"
#include <iomanip>

using namespace std;

class CheckingAccount : public bankingAccount
{
private:
	int tran;
	float fee;
	float temp;

public:
	void transactionsC();
	void transC();
	CheckingAccount();
	void withdrawl();
	
};

#endif

here is the first half of the bankingAccount file

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
284
285
286
287
288
289
290
291
292
293
294
295
296
#include "bankingAccount.h"
#include "SavingsAccount.h"
#include "CheckingAccount.h"

using namespace std;


void bankingAccount::acctInfoUpdate()
{
	char selection;

		cout << "Would you like to update your account information\n"
		<< "Press (Y) for yes, or\n"
		<< "Press (N) for no\n"
		<< "Then press ENTER: ";
	cin >> selection;

	switch (selection)
	{ 
	case 'y':
	case 'Y':
		cout << "\tWould you like to update your FIRST name: \n"
			<< "\tPress (Y) for yes, or\n"
			<< "\tPress (N) for no\n"
			<< "\tThen press ENTER: ";
		cin >> selection;
		
		switch (selection)
		{
		case 'y':
		case 'Y':
			cout << "\n\n\t\tPlease enter your FIRST name: ";
			cin >> firstName;
			
		case 'n':
		case 'N':
			break;
		default:
		
		cout << "\n\n\t\t****************************************\n"
		 << "\t\tINVALID SELECTION, Please try again\n"
		 << "\t\t***********************************\n\n";
		}

		cout << "\n\tWould you like to update your LAST name: "
			<< "\tPress (Y) for yes, or\n"
			<< "\tPress (N) for no\n"
			<< "\tThen press ENTER: ";
		cin >> selection;
		
		switch (selection)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\tPlease enter your LAST name: ";
			cin >> lastName;
		case 'n':
		case 'N':
			break;
		default:
		
		cout << "\n\n\t\t****************************************\n"
		 << "\t\tINVALID SELECTION, Please try again\n"
		 << "\t\t***********************************\n\n";
		}

		cout << "\n\tWould you like to update your CHECKING account number:\n"
			<< "\tPress (Y) for yes, or\n"
			<< "\tPress (N) for no\n"
			<< "\tThen press ENTER: ";
		cin >> selection;
		
		switch (selection)
		{
		case 'y':
		case 'Y':
			cout << "\nPlease enter your NEW numerical CHECKING account number:\n";
				cin >> CAnumber;
			cout << "\n\n***Remember to write this down for transactions***\n\n";
		case 'n':
		case 'N':
			break;
		default:
		
		cout << "\n\n\t\t****************************************\n"
		 << "\t\tINVALID SELECTION, Please try again\n"
		 << "\t\t***********************************\n\n";
		}
			
		cout << "\tWould you like to update your SAVINGS account number: "
			<< "\tPress (Y) for yes, or\n"
			<< "\tPress (N) for no\n"
			<< "Then press ENTER: ";
		cin >> selection;
		
		switch (selection)
		{
		case 'y':
		case 'Y':
			cout << "\n\nPlease enter your NEW numerical SAVINGS account number:\n";
				cin >> SAnumber;
			cout << "\n***Remember to write this down for transactions***\n";
		case 'n':
		case 'N':
			break;
		default:
		
		cout << "\n\n\t\t****************************************\n"
		 << "\t\tINVALID SELECTION, Please try again\n"
		 << "\t\t***********************************\n\n";
		}
	

	case 'n':
	case 'N':
		break;

	default:
		
		cout << "\n\n\t\t****************************************\n"
		 << "\t\tINVALID SELECTION, Please try again\n"
		 << "\t\t***********************************\n\n";
	}

	cout << "\n\n***Thank you for updating you account information***\n\n";
}

void bankingAccount::acctInfo()
{
	
	CheckingAccount check;
	SavingsAccount save;

	if (firstName.empty())
	{
		cout << "\n\t\tNO account inforamtion entered,\n"
			<< "\t\tPlease restart and choose option (1)\n\n";
	}
	else
	{
		cout << "\n\n\t\t" << firstName << " " << lastName;
		cout << "\n\t\t********************************\n"
			<< "Checking Account Number: " << CAnumber 
			<< "\nChecking Account total: " << CAtotal
			<< "\nThe number of Checking transactions is ";
		check.transC();
		cout << "\n\nSavings Account Number: " << SAnumber
			<<"\nSavings Account total: " << SAtotal
			<< "\nThe number of Savings transactions are ";
		save.tranS();
		cout << "\n\nThe total number of transactions is " << tran << endl;
	}
}

void bankingAccount::insufficent()
{
	do
		{
		cout << "\n**There are insufficent funds in this savings account**\n"
			<< "**Please deposit additions funds.**\n\n";
		}
	while (SAtotal <= 0);
	
	do 
		{
			cout << "\n**There are insufficent funds in this checking account**\n"
			<< "**Please deposit additions funds.**\n\n";
		}
	while (CAtotal <= 0);
}

void bankingAccount::withdrawl()
{
	CheckingAccount check;
	SavingsAccount save;
	char choose;

	cout << "\nPlease choose (C) for (C)HECKING,\n"
		<< "or choose (S) for (S)AVINGS: ";
	cin >> choose;
	
	switch (choose)
	{
	case 's':
	case 'S':
		cout << "\n\tPlease enter the SAVINGS account number,"
			<< "\n\tfollowed by ENTER: ";
		cin >> acct;

		if (acct == SAnumber)
		{
			
			cout << "\n\nThe SAVINGS account total is: " << SAtotal; 
			cout << "\nPlease enter the amount you"
				<< " would like to withdrawl: ";
			cin >> temp;
			
			for (int i = 0; i < 100; i++)
				{
				recTranSW[i] = temp;
				}
			
			cout << "\n\nYou have chosen to withdrawl " << temp << ".";

			save.transactionsS();
			tran++;
						
		if ((CAtotal -=temp) > 0)
		{
			CAtotal -=temp;
			
			cout << "\n\nYour new total is: " << SAtotal;
		}
		
		else if ((SAtotal -=temp) <= 0)
		{
			insufficent();
			SAtotal += fee;			
		}

		else if (temp >= 10000)
		{
			cout << "\nWOW!!! That's quite a bit of pocket cash!!\n"
				<< "Do you really need that much!?!?(It's a simulator.)\n\n";
		}

		}

		else if (acct != SAnumber)
		{
			cout << "\n\n\t\tThe SAVINGS account number entered is INVALID\n" 
				<< "\t\tYou will now be exiting!\n"
				<< "\t\tCause it's not your account..."
				<< "\n\n\t\tand I said so!!";
			system("PAUSE");
		}
		
	case 'C':
	case 'c':
		
		cout << "Please enter the CHECKING account number,"
			<< "\nfollowed by ENTER: ";
		cin >> acct;

		if (acct == CAnumber)
		{
			cout << "\n\n\tThe CHECKING account total is: " << CAtotal; 
			cout << "\n\tPlease enter the amount you"
				<< " would like to withdrawl: ";
			cin >> temp;
			for (int j = 0; j < 100; j++)
				{
				recTranCW[j] = temp;
				}

			cout << "\n\tYou have chosen to withdrawl " 
				<< temp << ".";

			check.transactionsC();
			tran++;
						
			if ((CAtotal -=temp) > 0)
			{
				CAtotal -=temp;
				cout << "\n\tYour new total is: " << CAtotal;
			}
		
			else if ((CAtotal -=temp) <= 0)
			{
				insufficent();
				CAtotal += fee;			
			}

			else if (temp >= 10000)
			{
				cout << "\nWOW!!!That's quite a bit of pocket cash!!\n"
					<< "do you really need that much!?!?(It's a simulator.)\n";
			}

		}

		else if (acct != CAnumber)
		{
			cout << "\n\n\t\tThe account number entered is INVALID\n" 
				<< "\t\tYou will now be exiting!\n"
				<< "\t\tCause it's not your account..."
				<< "\n\n\t\tand I said so!!";
			system("PAUSE");
		}
		
	default:
		cout << "/n/n/t/tINVALID SELECTION, PLEASE TRY AGAIN";
		break;
	}
}
The middle of the bankingAccount file

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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
void bankingAccount::deposit()
{
	CheckingAccount check;
	SavingsAccount save;
	char choose;

	cout << "\nPlease choose (C) for (C)HECKING,\n"
		<< "or choose (S) for (S)AVINGS: ";
	cin >> choose;
	
	switch (choose)
	{
	
	case 's':
	case 'S':
		
		cout << "\n\tPlease enter the SAVINGS account number,"
			<< "\n\tfollowed by ENTER: ";
		cin >> acct;
		
		if (acct = SAnumber)
		{
			cout << "\n\n\tThe SAVINGS account total is: " << SAtotal; 
			cout << "\n\tPlease enter the amount to deposit, "
				<< "\n\tfollowed by ENTER: ";
			cin >> temp;
		
			for (int l = 0; l < 99; l++)
				{
				recTranCD[l] = temp;
				}

			if (temp >= 1000000)
			{
				cout << "\n\nWOW really, it's just a simulator, by the way!!\n\n";
			}
			
			SAtotal += temp;

			cout << "\n\nYour new total is: " << SAtotal;
			
			save.transactionsS();
			tran++;
		
		}
		else if (acct != CAnumber)
		{
			cout << "\n\n\t\tThe account number entered is INVALID\n" 
				<< "\t\tYou will now be exiting!\n"
				<< "\t\tCause it's not your account..."
				<< "\n\n\t\tand I said so!!";
			system("PAUSE");
			exit(0);
		}
	
	case 'c':
	case 'C':

		cout << "\nPlease enter the CHECKING account number,"
			<< "\nfollowed by ENTER: ";
		cin >> acct;

		if (acct = CAnumber)
		{
			cout << "\n\n\tThe CHECKING account total is: " << CAtotal; 
			cout << "\n\tPlease enter the amount to deposit, "
				<< "\n\tfollowed by ENTER: ";
			cin >> temp;
	
			for (int k = 0; k < 99; k++)
				{
				recTranCD[k] = temp;
				}

			if (temp >= 1000000)
			{
				cout << "\n\nWOW really, it's just a simulator, by the way!!\n\n";
			}
			
			CAtotal += temp;

			cout << "\n\nYour new total is: " << CAtotal;
		
			check.transactionsC();
			tran++;
		
		}
	
		else if (acct != CAnumber)
		{
		cout << "\n\n\t\tThe account number entered is INVALID\n" 
			<< "\t\tYou will now be exiting!\n"
			<< "\t\tCause it's not your account..."
			<< "\n\n\t\tand I said so!!";
		system("PAUSE");
		exit(0);
		}
	}

}

void bankingAccount::CDtran()
{
	cout << "\n\t\t1 - 20 CHECKING-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 0; m < 20; m++)
	{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCD[m] << endl;
	}
		cout << "Would you like the 21 - 40? (Y or N) ";
		char choice;
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\21 - 40 CHECKING-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 20 ; m < 40; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCD[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 41 - 60? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\41 - 60 CHECKING-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 40 ; m < 60; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCD[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 61 - 80? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\61 - 80 CHECKING-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 60 ; m < 80; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCD[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 81 - 100? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t81 - 100 CHECKING-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 80 ; m < 100; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCD[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}
	}

void bankingAccount::SDtran()
{
	cout << "\n\t\t1 - 20 SAVINGS-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 0; m < 20; m++)
	{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSD[m] << endl;
	}
		cout << "Would you like the 21 - 40? (Y or N) ";
		char choice;
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\21 - 40 SAVINGS-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 20 ; m < 40; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSD[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 41 - 60? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\41 - 60 SAVINGS-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 40 ; m < 60; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSD[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 61 - 80? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\61 - 80 SAVINGS-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 60 ; m < 80; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSD[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 81 - 100? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t81 - 100 SAVINGS-DEPOSIT TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 80 ; m < 100; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSD[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}
	}

void bankingAccount::CWtran()
{
	cout << "\n\t\t1 - 20 CHECKING-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 0; m < 20; m++)
	{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCW[m] << endl;
	}
		cout << "Would you like the 21 - 40? (Y or N) ";
		char choice;
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\21 - 40 CHECKING-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 20 ; m < 40; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCW[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 41 - 60? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\41 - 60 CHECKING-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 40 ; m < 60; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCW[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 61 - 80? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\61 - 80 CHECKING-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 60 ; m < 80; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCW[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 81 - 100? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t81 - 100 CHECKING-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 80 ; m < 100; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranCW[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}
	}


The end of bankingAccount

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
void bankingAccount::SWtran()
{
	cout << "\n\t\t1 - 20 SAVINGS-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 0; m < 20; m++)
	{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSW[m] << endl;
	}
		cout << "Would you like the 21 - 40? (Y or N) ";
		char choice;
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\21 - 40 SAVINGS-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 20 ; m < 40; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSW[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 41 - 60? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\41 - 60 SAVINGS-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 40 ; m < 60; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSW[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 61 - 80? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t\61 - 80 SAVINGS-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 60 ; m < 80; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSW[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}

		cout << "Would you like the 81 - 100? (Y or N) ";
		
		cin >> choice;
		switch (choice)
		{
		case 'y':
		case 'Y':
			cout << "\n\t81 - 100 SAVINGS-WITHDRAWL TRANSACTIONS\n"
		<< "----------------------------------------\n";
	
		for (int m = 80 ; m < 100; m++)
		{
		cout << "Transaction " << m + 1 << ": " 
			<< recTranSW[m] << endl;
		}
		break;

		case 'n':
		case 'N':
			break;
		default:
			break;
		}
	}
SavingsAccount file...I know it's unfinished

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
#include "SavingsAccount.h"

using namespace std;

float SAtotal;
int SAnumber;

void SavingsAccount::interest(float yearTotal, float dailyTotal)
{
	yearly = .0051;
	daily = yearly/365;
	temp1 = SAtotal * yearly;
	yearTotal = SAtotal + temp1;

	temp2 = daily * SAtotal;
	dailyTotal = SAtotal + temp2;

	cout << "Your total with yearly interest is " << yearTotal << ".\n"
		<< "Your total with daily interest is " << dailyTotal << ".\n";
	
}

void SavingsAccount::inquiry(int random)
{
	srand(time(0));
	
	random = rand() % 6;

	cout << "It has been " << random << " days"
		<< "since your last inquiry.";
}

void SavingsAccount::transactionsS()
{
	tran++;

	if (tran >= 4)
			{
				SAtotal -= fee;
				cout << "\tA transaction fee of $" << fee
					<< " has been withdrawl\n"
					<< "\tfor (3) or more transactions, you have\n"
					<< "\treached " << tran << " transactions on\n"
					<< "\tthis SAVINGS account.\n";
			}
}

void SavingsAccount::tranS()
{
	cout << tran;
}
The CheckingAccount file

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
#include "CheckingAccount.h"


using namespace std;



void CheckingAccount::transactionsC()
{
	tran++;

	if (tran >= 4)
			{
				CAtotal -= fee;
				cout << "\tA transaction fee of $" << fee
					<< " has been withdrawl\n"
					<< "\tfor (3) or more transactions, you have\n"
					<< "\treached " << tran << " transactions"
					<< "\ton this CHECKING account.\n";
			}
}
void CheckingAccount::transC()
{
	cout << tran;
}

void CheckingAccount::withdrawl()
{
fee = 5.00;
}
Last edited on
AND FINALLY!!!

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

#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include "bankingAccount.h"
#include "CheckingAccount.h"
#include "SavingsAccount.h"
#include <ctime>

using namespace std;

// prototypes

void menu();

// main function

int main ()
{
		
	cout << showpoint << setprecision(2) << endl;
	menu();

	system("PAUSE");
}

// end main


// main functions

void menu()
{
	bankingAccount newAcct;
	int mainMenu;

	cout << "Please select one of the following options:\n\n"
		<< "\t\t1: UPDATE account information\n"
		<< "\t\t2: DISPLAY account informaion\n"
		<< "\t\t3: DEPOSIT from an account \n"
		<< "\t\t4: WITHDRAWL from an account \n"
		<< "\t\t5: EXIT\n\n"
		<< "\t\tIf NO account information \n\t\thas been entered,"
		<< "\n\t\tPlease select (1), thank you: ";


	cin >> mainMenu;

	switch (mainMenu)
	{
	case 1:
		cout << "\n\t\tYou chose UPDATE account information\n\n";
		newAcct.acctInfoUpdate();
		break;

	case 2:
		cout << "\n\t\tYou chose DISPLAY account information\n\n";
		newAcct.acctInfo();
		break;

	case 3:
		cout << "\n\t\tYou chose DEPOSIT\n\n";
		newAcct.deposit();
		break;

	case 4:
		cout << "\n\t\tYou chose WITHDRAWL\n\n";
		newAcct.withdrawl();
		break;

	case 5:
		cout << "\n\t\tYou chose EXIT\n\n";
		system("PAUSE");
		exit(0);
		break;
		
	default:
		cout << "\n\t\tINVALID SELECTION\n";
	}
}


I'm not asking anyone to reformat, fix or harp on the way I wrote it. I am a beginner. I'm getting this error code a few time in the compiler. Is there someone brave enough to try and find me a reason. Again big thanks...THANKS

1>c:\users\adm1\documents\visual studio 2010\projects\comp220 w3 ilab\comp220 w3 ilab\bankingaccount.h(46): error C2064: term does not evaluate to a function taking 1 arguments

EDIT:
This error code shows up 6 times for bankingAccount.h, lines 44 and 46 of the first post for that file.
Last edited on
Constructor example:
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
struct base_class
{
    base_class( int i, double d ) ; // base class constructor
    // ...
    int a ;
    double b ;
};

struct derived_class : base_class
{
    derived_class( int i, double d, char ch  ) ; // derived class constructor
    // ...
    char c ;
};

base_class::base_class( int i, double d ) // base class constructor
               : a(i), // initialize member a
                 b{d}  // initialize member d (alternate syntax, C++11)
{
    // ...
}

derived_class::derived_class( int i, double d, char ch  ) // derived class constructor
                        : base_class( i, d ), // initialize base_class object
                          // or: base_class{ i, d }, // (alternate syntax, C++11)
                          c(ch) // initialize member ch
{
    //...
}
Thank you
Next time, take small baby steps, one at a time.

Write the outline of the class bankingAccount in the header bankingAccount.h, and then start with an empty bankingAccount.cpp with just this much in it:

#include "bankingAccount.h"

Compile - fix errors - recompile till the errors are gone.
Add declarations of members one by one to bankingAccount, compile - fix errors - recompile ...
Once the class is complete, implement the first member function in bankingAccount.cpp, compile - fix errors - recompile ...
And so on for each member.

Not repeat the above for the first derived class. And so on and so forth.
Yeah, late night programming is not so good sometimes. I was able to break it down in test files and get it to work, little by little. It's advice I will surely keep in the fore thought as I continue on.
Topic archived. No new replies allowed.