whats wrong with this code.plz help me.

the problem is in main()
contact details are working properly,but appointment part is not working.plz coorct it for me.
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
#include<iostream>
#include<iomanip>
#include<string>
#include<conio.h>
using namespace std;

class Date
{
private:
	int day, month, year;
public:
	Date()
	{
		day = 1; month = 1; year = 1900;
	}
	Date(int d, int m, int y)
	{
		day = d, month = m, year = y;
	}

	void setDay(int d){
		day = d;
	}
	void setMonth(int m){
		month = m;
	}
	void setYear(int y){
		 year= y;
	}

	
	void show(){
		cout << day << "-" << month << "-" << year << endl;
	}

	void setDate(){
	
		cout<<"Enter the date:"<<endl;
	cin>>day>>month>>year;
	}
};




class Time

{
private:

	int hr, min;
	string zone;

public:


	void displayTime(){
		cout << hr << ":" << min << " " << zone << endl;
	}

	Time(int hour, int minute){

		hr = hour;
		min = minute;
	}

	Time(){
		hr = 0;
		min = 0;
		
	}
	void setHour(int h){
		hr = h;

	}
	void setMin(int m){
		min = m;

	}
	void setCh(string z){
		zone = z;

	}
	void setTime(){
	
			cout<<"Enter time:"<<endl;
		cin>>hr>>min>>zone;
	
	}

	

};
class Contact {
private:
string FirstName;
string LastName;
string PhoneNumber;
string EmailID;
public:
	Contact();
	void addContact();
	void displayContact();
};
Contact::Contact()
{
}
void Contact:: addContact() {
cout << "Enter First Name: " << endl;
cin >> FirstName;
cout << "Enter Last Name: " << endl;
cin >> LastName;
cout << "Enter Phone Number: " << endl;
cin >> PhoneNumber;
cout << "Enter Email ID: " << endl;
cin >> EmailID;
}

void Contact::displayContact() {
	cout<<setiosflags(ios::left)<<setw(10)<<FirstName<<setw(13)<<LastName<<setw(7)<<PhoneNumber<<setw(7)<<EmailID<<endl;
	return;

}

class appointment:public Contact
{
private:
	string appointment_Name;
	Date appointment_Date;
	Time appointment_Time;
public:
	void setappointmentInfo(){

		Contact::addContact();
		
		
		cout<<"Enter the name of appointment:"<<endl;

		cin>>appointment_Name;
		
		appointment_Time.setTime();
		
		appointment_Date.setDate();
	}
	void displayappointment(){
		Contact::displayContact();
		
		cout << "Name of the appointment: " << appointment_Name << endl;
		cout << "Date of appointment:"  << endl;
		appointment_Date.show();
		cout << "Time of the appointment" << endl;
		appointment_Time.displayTime();


		
	}
	appointment(string name, Contact mehdi,Contact shah,Contact phoneNumber,Contact EmailID,int month, int day, int year, int hour, int min,string zone):Contact(mehdi){
		appointment_Name = name;
		appointment_Time.setHour(hour);
		appointment_Time.setMin(min);
		appointment_Date.setMonth(month);
		appointment_Date.setDay(day);
		appointment_Date.setYear(year);
		appointment_Time.setCh(zone);
	}
	appointment(){

	}



};

int main(){
	cout<<"\t \t \t Wellcome To Electronic Diary System"<<endl;
	cout<<"\t \t \t -----------------------------"<<endl<<endl;

	Contact myContacts[3];
	for(int i=0;i<3;i++){
	myContacts[i].addContact();
	}
	cout << "Contact details as follows: " << endl;
	for(int i=0;i<3;i++){

	myContacts[i].displayContact();
	}

	appointment a[2];
	for(int i=0;i<2;i++){
		a[i].setappointmentInfo();
	}
	for(int i=0;i<2;i++){
		a[i].displayappointment();
	}
	getch();
	return 0;
	}
Can you tell me what this program does?
Is it File handling..?
Topic archived. No new replies allowed.