Derived/base find

Hi guys,
I have this project to do, and approximately no idea how to do it. I can start it, but I honestly have only a slight grasp on how this program is supposed to function.
The directions are as follows-
Write A program that has a base class with has client information – private members : ACCOUNT NUMBER, NAME, TELEPHONE, DATE , BALANCE, quarterly percent RETURN (calculated) and a derived class with client NAME, ADDRESS, TELEPHONE. The derived class is needed because potential and past clients are included in the derived class.
Your program should be able find a client by name and by account number.
You r program should be able to calculate how long the person has been a client given the DATE.. The base class and derived class must be in a header file. Your program should be able have at least 20 clients.

I started thus far:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
#include <string>
using namespace std;

class accntInfo{
private:
	int accNumber;
	string name;
	int tel;
	int date;
	int bal;
	int QPR;
};

class persInfo: public accntInfo {
private:

};





I know I how base and derived work, but how do I go about using it to fit the rules of what I have to do. Advise asap!
Last edited on
Worked some more:

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
#include <iostream>
#include <string>
using namespace std;

class accntInfo{
private:
	string accNumber;
	string name;
	int tel;
	int date;
	int bal;
	int QPR;
public:
	accntInfo(string a = "A1", string n = "AA", int t = 000000000,
		int date = 00, int bal = 000, int QPR = 0);
	void putAccNum(string an)
	{
		accNumber = an;
	}
	void putName(string nam)
	{
		name = nam;
	}
	void putTel(int telly)
	{
		tel = telly;
	}
	void putDate(int m, int d, int y)
	{
		int mRef = 1;
		int dRef = 1;
		int yRef = 00;
		int ref = 0;
		int today=m*30 + d + y*360
	}

};

class persInfo: public accntInfo {
private:

};
Last edited on
working again:
no errors but doesnt allow input for anything beyond telephone
and the output--
everything is like - 87932823434 (im approximating)


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
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
#include <iostream>
#include <string>
using namespace std;

class current{
private:
	string AccntNumber;
	string name;
	int tel;
	int date;
	int bal;
	int QPR;

public:
	
	void putAccntNumber(string an)
	{
		AccntNumber = an;
	}
	void putName(string nam)
	{
		name = nam;
	}
	void putTel(int telly)
	{
		tel = telly;
	}
	void putDate(int m, int d, int y)
	{
		int today = m * 30 + d + y * 360;
		date = today;
	}
	void putBal(int b)
	{
		bal = b;
	}
	void putQPR(int q)
	{
		QPR = q;
	}
	string getAccntNumber()
	{
		return AccntNumber;
	}
	
	string getName()
	{
		return name;
	}
	int getTel()
	{
		return tel;
	}
	int getDate()
	{
		int ref = 0;
		return date - ref;
	}
	int getBal()
	{
		return bal;
	}
	int getQPR()
	{
		return QPR;
	}

};

class past: public current {
private:
	string address;
public:
	void putAdd(string ad)
	{
		address = ad;
	}
	string getAdd()
	{
		return address;
	}

};

int main()
{
	string curAN, pasAN;
	string curName, pasName;
	int curTel, pasTel;
	int curDateM, curDateD,curDateY , pasDateM, pasDateD, pasDateY;
	int curBal, pasBal;
	int curQPR, pasQPR;
	string pasAD;

	current client1;
	past Past1;

	
	cout << "\nPlease enter the client's account number"
		<< endl;
	cin >> curAN;
	client1.putAccntNumber(curAN);
	
	cout << "\nPlease enter the client's name" << endl;
	cin >> curName;
	client1.putName(curName);

	cout << "\nPlease enter the client's telephone number"
		<< endl;
	cin >> curTel;
	client1.putTel(curTel);

	cout << "\nPlease enter when the client joined the company"
		<< endl;
	cin >> curDateM >> curDateD >>curDateY;
	client1.putDate(curDateM, curDateD, curDateY);

	cout << "\nPlease enter the client's balance"
		<< endl;
	cin >> curBal;
	client1.putBal(curBal);
	
	cout << "\nPlease enter the client's Quarterly Percent Return"
		<< endl;
	cin >> curQPR;
	client1.putQPR(curQPR);

	
	cout << "\nPlease enter the past client's account number" << endl;
	cin >> pasAN;

	Past1.putAccntNumber(pasAN);
	cout << "\nPlease enter the past client's address" << endl;
	cin >> pasAD;
	Past1.putAdd(pasAD);

	cout << "\nPlease enter the past client's telephone number"
		<< endl;
	cin >> pasTel;
	Past1.putTel(pasTel);

	cout << "\nPlease enter when the past client joined the company. "
		<< " The month first, then day, then year."
		<< endl;
	cin >> pasDateM >> pasDateD >> pasDateY;
	Past1.putDate(pasDateM, pasDateD, pasDateY);

	cout << "\nPlease enter the past client's balance"
		<< endl;
	cin >> pasBal;
	Past1.putBal(pasBal);

	cout << "\nPlease enter the past client's last Quarterly Percent Return"
		<< endl;
	cin >> pasQPR;
	Past1.putQPR(pasQPR);

	

	
	cout << "\nThe client's account number is " << endl << client1.getAccntNumber()
		<< endl << "The name is " << client1.getName() << endl << "The telephone is "
		<< client1.getTel() << endl << "The balance is " << client1.getBal() << endl
		<< "The date is " << client1.getDate() << endl << "The QPR is " << client1.getQPR()
		<< endl;
	cout << "\nThe past client's account number is " << endl << Past1.getAccntNumber()
		<< endl << "The name is " << Past1.getName() << endl << "The telephone is "
		<< Past1.getTel() << endl << "The balance is " << Past1.getBal() << endl
		<< "The date is " << Past1.getDate() << endl << "The QPR is " << Past1.getQPR()
		<< endl;
	cout << "\nThe past client's address is " << endl << Past1.getAdd();

	system("pause");
	return 0;

}
Last edited on
Topic archived. No new replies allowed.