please correct these 6 C++ errors

as content size is limited to 9000 characters... i have posted the source code in:

http://www.mediafire.com/view/?8cn2skrvevcr4dd
Why don't you just post the snippets of code that are causing you problems?
man, i tried now... im a beginner... please try my code on that and find out... this is my project...i have grades for this... PLEASE !!
Last edited on
I'm not going to click on a link I don't know what is behind it do I. You should be able to just paste the snippets of code that is causing you a problem.
the link's legit, but copy-paste would still be better
ok i'll post it into 2 parts...
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
#include<process.h>
#include<stdio.h>
#include<string.h>
int access=0; // for accessing data modifier functions
int report_s=0;
int report_u=0;
class element
{
int at_no;
float mass_no;
char name[15];
char symbol[4];
int group,period; //for displaying the table
public:

void input()
{
cout<<"enter elements name \n";
gets(name);
cout<<"enter its symbol \n";
gets(symbol);
cout<<"enter its atomic number \n";
cin>>at_no;
cout<<"enter its mass number\n";
cin>>mass_no;
cout<<"enter its group number\n";
cin>>group;
cout<<"enter its period number\n";
cin>>period;
}
void output()
{
cout<<"elements name:"<<name<<"\n";
cout<<"symbol:"<<symbol<<"\n";
cout<<"atomic number:"<<at_no<<"\n";
cout<<"mass number:"<<mass_no<<"\n";
}
char*sym()
{return symbol;}
char *nam()
{return name;}
int atno()
{return mass_no;}
int ret_period()
{return group;}
}e;

struct user
{
char name[20];
private:
char password[10];
public:
void input()
{
cout<<"\nenter name";
gets(name);
cout<<"\nenter password:\n";
gets(password);
}
char*getpassw()
{return password;}
void inpass()
{
cout<<"enter password\n";
gets(password);
}
}
u;
void report(element,char);
void report();
void login()
{
access=0;
int i;
char ch;
do
{
clrscr();
cout<<"\t\t\t\tlogin menu\n\n";
cout<<"enter type of user:\n\n";
cout<<"\t\t1.new user\n";
cout<<"\t\t2.existing user\n";
cout<<"\t\t3.quit\n\n\n";
cout<<"your choice";
cin>>ch;
switch(ch)
{
case '1':
{
int presence=0; //for checking presence of record (user)
u.input();
user b;
ifstream fin("users.dat",ios::binary|ios::in);
if(!fin)
cout<<"error";
while(!(fin.eof()))
{
if(fin.eof())
break;
fin.read((char*)&b,sizeof(user));
if(strcmp(b.name,u.name)==0)
{
cout<<"name exists, try again";
getch();
fin.close();
presence=1; //presence is true
break;
} // end of if
break; // break for case 1
} // close of case 1
case '2':
{
int i=0;
u.input();
user b;
ifstream fin("users.dat",ios::binary|ios::in);
if(!fin)
cout<<"error";
while(!(fin.eof()))
{
if(fin.eof())
break;
fin.read((char*)&b,sizeof(user));
if((strcmp(b.name,u.name)==0)&&(strcmp(b.getpassw(),u.getpassw())==0))
{
if(strcmp(u.name,"administrator")==0)
{
fin.close();
access=1;
return;
} //close of inner if
fin.close();
return;
} //close of if
if(strcmp(u.name,b.name)==0)
{
for(i=0;i<3;)
{
cout<<"enter the correct password \n";
u.inpass();
if(strcmp(u.getpassw(),b.getpassw())==0)
{
if(strcmp(u.name,"administrator")==0)
access=1;
return;
}
else
i++;
} // close of loop
} // close of if
if(i>=3)
{
cout<<"invalid password. program will now terminate";
fin.close();
getch();
exit(0);
}
} // close of while
cout<<"user not found";
getch();
break;
} //close of case 2
case '3':
{
clrscr();
char opt;
cout<<"are you sure? (y/n) \n";
cin>>opt;
if(opt=='y')
{
clrscr();
gotoxy(33,13);
cout<<"thank you";
getch();
exit(0);
}
break;
}
default:
{
cout<<"enter a valid option";
getch();
} // close of switch
} while(1); //close of do while
} // close of function
void disp_period()
{
clrscr();
ifstream fin("period.dat",ios::binary|ios::in);
if(!fin)
cout<<"error";
cout<<"\t\t\t the modern periodic table";
while(!fin.eof())
{
if(fin.eof())
break;
fin.read((char*)&e,sizeof(element));
gotoxy(4*e.ret_group()),(e.ret_period+5));
cout<<e.sym();
}
fin.close();
getch();
}
void search()
{
char ch;
int result=0; //for checking success of search
do
{
result=0;
clrscr();
cout<<"\t\t\tthe periodic table\n\n";
cout<<"\t\tsearch modes available \n\n";
cout<<"1.element symbol\n";
cout<<"2.element name\n";
cout<<"3.atomic number\n";
cout<<"4.return to main memory\n";
cout<<"your choice:";
cin>>ch;
ifstream a("period.dat",ios::binary);
if(!a)
cout<<"error";
switch(ch)
{
case '1':
{
char symbol[3];
cout<<"enter the elements symbol\n";
gets(symbol);
while(!(a.eof()))
{
if((a.eof()))
break;
a.read((char*)&e,sizeof(element));
if(strcmpi(e.sym(),symbol)==0)
{
e.output();
report(e,'s'); //for sending result of search to report()
getch();
result=1;
break;
}
}
a.close();
break;
}
case '2':
{
char name[20];
cout<<"enter the elements name\n";
gets(name);
while(!a.eof())
{
if(a.eof())
break;
a.read((char*)&e,sizeof(element));
if(strcmpi(e.nam(),name)==0)
{
e.output();
report(e,'s');
getch();
result=1;
break;
}
}
a.close();
break;
}
case'3':
{
int atno;
cout<<"enter the elements atomic no.\n";
cin>>atno;
while(!(a.eof()))
{
if((a.eof()))
break;
a.read((char*)&e,sizeof(element));
if(e.atno()==atno)
{
e.output();
report(e,'s');
getch();
result=1;
break;
}
}
a.close();
break;
}
case '4' : return; //no need break as the control is passed on,
//fall through does not occur
default:
{
cout<<"enter a valid option";
getch();
}
}
if(!result)
{
cout<<"sorry, no entry found";
getch();
}
}while(1);
}
void period_det()
{
int presence; // for checking presence of element in database
char ch;
do
{
presence=0;
clrscr();
cout<<"\t\tperiodic table details \n\n";
cout<<"1. add element \n";
cout<<"2. modify element\n";
cout<<"3. display periodic table\n";
cout<<"4. return to main menu\n";
cout<<"enter your choice : ";
cin>>ch;
switch(ch)
{
case '1' :
{
if(access)
{
element e3;
e.input();
ifstream a("period.dat",ios::binary);
if(!a)
cout<<"error";
a.seekg(0);
while(!a.eof())
{
if(a.eof())
break;
a.read((char*)&e3,sizeof(element));
if(strcmpi(e3.sym(),e.sym())==0) || (strcmpi(e3.nam(),e.nam())==0) || (e3.atno()==e.atno()) || ((e3.ret_period))==e.ret_period())&&(e3.ret_group()==e.ret_group())) || (e3.massno()==e.massno())
{e3.output();presence=1;break;}
}
a.close();
if(!presence)
{
ofstream b("period.dat",ios::binary|ios::app);
if(!b)
cout<<"error";
b.write((char*)&e,sizeof(element));
cout<<"element added\n";
getch();
b.close();
report(e,'u');
}
else
{
cout<<"element already present";
getch();
}
break;
}
else
{
clrscr();
cout<<"access denied";
getch();
break;
}
}
case '2' :
{
if(access)
{
int result=0;
char ele_name[20];
cout<<"enter name of element to be modified\n";
gets(ele_name);
fstream f("period.dat",ios::binary|ios::in|ios::out);
if(!f)
cout<<"error";
f.seekg(0);
while(!f.eof())
{
if(f.eof())
break;
f.read((char*)&e,sizeof(element));
if(strcmpi(ele_name,e.nam())==0)
{
result=1;
char choice;
e.output();
cout<<"do you want to modify this record(y/n)";
cin>>ch;
if(ch=='y'||ch=='y')
{
f.seekp(f.tellg()-(sizeof(element)));
e.input();
ifstream g("period.dat",ios::binary);
if(!g)
cout<<"error";
element h;
int unique =1;
while(!g.eof())
{
if(g.eof())
break;
g.read((char*)&h,sizeof(element));
if((strcmpi(h.sym(),e.sym())==0) || (strcmpi(h.nam(),e.nam())==0) || (h.atno()==e.atno())
|| (h.ret_period()==e.ret_period()0&&(h.ret_group()==e.ret_group())) || (h.massno()==e.massno()))
{unique=0;
cout<<"element with modified data exists\n";
h.output();
getch();
break;
}
}
if(unique)
{f.write((char*)&e,sizeof(element));
report(e,'u');
cout<<"record edited";
getch();
}
break;
}
}
}
if(!result())
cout<<"no such record found";
getch();
f.close();
break;
}
else {
clrscr();
cout<<"access denied";
getch();
break;
}
}
case '3':
{
disp_period();
break;
}
case '4':
{
return;
}
default:
cout<<"enter a valid option";
getch();
}
}while(1);
}
void report(element e,char type)
{
if(type=='s')
{
report_s=1;
ofstream fout("reportsearch.dat",ios::binary|ios::app);
if(!fout)
cout<<"error";
else
fout.write((char*)&e,sizeof(element));
fout.close();
}
}
void report()
{
ifstream fin("reportsearch.dat",ios::binary);
if(!fin)
cout<<"error";
else
{
if(report_s)
{
clrscr();
cout<<"\tsearch report\n";
while(!fin.eof())
{
fin.read((char*)&e,sizeof(element));
if(fin.eof())
break;
e.output();
getch();
}
fin.close();
cout<<"end of search report";
getch();
}
else
{
clrscr();
cout<<"no search report found\n";
getch();
{
if(access)
{
if(report_u)
{
ifstream fin("reportupdate.dat",ios::binary);
if(!fin)
cout<<"error";
else
{
clrscr();
cout<<"\tupdate report\n";
while(!fin.eof())
{
fin.read((char*)&e,sizeof(element));
if(fin.eof())
break;
e.output();
getch();
}
fin.close();
cout<<"end of update report";
getch();
}
}
else {
clrscr();
cout<<"no update report found";
getch();
}
}
}
}
void main()
{
ofstream z("reportsearch.dat",ios::binary|ios::trunc);
if(!z)
cout<<"error";
z.close();
ofstream y("reportupdate.dat",ios::binary|ios::trunc);
if(!y)
cout<<"error";
y.close();
clrscr();
highvideo();
char ch;
gotoxy(25,12);
highvideo();
cout<<"welcome to the periodic table\n";
getch();
login();
do
{
clrscr();
cout<<"\t"<<"\t"<<"the periodic table\n\n";
cout<<"1. periodic table details\n";
cout<<"2. search for element \n";
cout<<"3. report\n";
cout<<"4.switch user\n";
cout<<"5. quit\n";
cout<<" enter you choice";
cin>>ch;
switch(ch)
{
case '1': period_det(); break;
case '2': search(); break;
case '3': report(); break;
case '4': login(); break;
case '5': clrscr();
char opt;
cout<<"are you sure?? (y/n) \n";
cin>>opt;
if(opt=='y')
{
clrscr();
gotoxy(33,13);
cout<<"thank you";
getch();
exit(0);
}
break;
default:cout<<"enter a valid option";
getch();
}
}while(1);
}
So where are the errors located and what errors do you get?

Would make it easier to read if you put the code inside code blocks.
it says content too long for code blocks... :(
Last edited on
To start of you need to change the first two includes to:

1
2
 #include <iostream>	
 #include<fstream> 


Then prefix each of the std library functions you are using with std:: i.e.:

 
std::cout ...


Would be advisable if you indented your code, although this maybe due to pasting code into message.

I'm still looking...
no, please correct the braces first..can you? :/
http://www.cplusplus.com/forum/articles/42672/

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
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
#include<process.h>
#include<stdio.h>
#include<string.h>
int access=0; // for accessing data modifier functions
int report_s=0;
int report_u=0;
class element
{
int at_no;
float mass_no;
char name[15];
char symbol[4];
int group,period; //for displaying the table
public:

void input()
{
cout<<"enter elements name \n";
gets(name);
cout<<"enter its symbol \n";
gets(symbol);
cout<<"enter its atomic number \n";
cin>>at_no;
cout<<"enter its mass number\n";
cin>>mass_no;
cout<<"enter its group number\n";
cin>>group;
cout<<"enter its period number\n";
cin>>period;
}
void output()
{
cout<<"elements name:"<<name<<"\n";
cout<<"symbol:"<<symbol<<"\n";
cout<<"atomic number:"<<at_no<<"\n";
cout<<"mass number:"<<mass_no<<"\n";
}
char*sym()
{return symbol;}
char *nam()
{return name;}
int atno()
{return mass_no;}
int ret_period()
{return group;}
}e;

struct user
{ 
char name[20];
private:
char password[10];
public:
void input()
{
cout<<"\nenter name";
gets(name);
cout<<"\nenter password:\n";
gets(password);
}
char*getpassw()
{return password;}
void inpass()
{
cout<<"enter password\n";
gets(password);
}
}
u;
void report(element,char);
void report();
void login()
{
access=0;
int i;
char ch;
do
{
clrscr();
cout<<"\t\t\t\tlogin menu\n\n";
cout<<"enter type of user:\n\n";
cout<<"\t\t1.new user\n";
cout<<"\t\t2.existing user\n";
cout<<"\t\t3.quit\n\n\n";
cout<<"your choice";
cin>>ch;
switch(ch)
{
case '1':
{
int presence=0; //for checking presence of record (user)
u.input();
user b;
ifstream fin("users.dat",ios::binary|ios::in);
if(!fin)
cout<<"error";
while(!(fin.eof()))
{
if(fin.eof())
break;
fin.read((char*)&b,sizeof(user));
if(strcmp(b.name,u.name)==0)
{
cout<<"name exists, try again";
getch();
fin.close();
presence=1; //presence is true
break;
} // end of if
break; // break for case 1
} // close of case 1
case '2':
{
int i=0;
u.input();
user b;
ifstream fin("users.dat",ios::binary|ios::in);
if(!fin)
cout<<"error";
while(!(fin.eof()))
{
if(fin.eof())
break;
fin.read((char*)&b,sizeof(user));
if((strcmp(b.name,u.name)==0)&&(strcmp(b.getpassw(),u.getpassw())==0))
{
if(strcmp(u.name,"administrator")==0)
{
fin.close();
access=1;
return;
} //close of inner if
fin.close();
return;
} //close of if
if(strcmp(u.name,b.name)==0)
{
for(i=0;i<3;)
{
cout<<"enter the correct password \n";
u.inpass();
if(strcmp(u.getpassw(),b.getpassw())==0)
{
if(strcmp(u.name,"administrator")==0)
access=1;
return;
}
else
i++;
} // close of loop
} // close of if
if(i>=3)
{
cout<<"invalid password. program will now terminate";
fin.close();
getch();
exit(0);
}
} // close of while
cout<<"user not found";
getch();
break;
} //close of case 2
case '3':
{
clrscr();
char opt;
cout<<"are you sure? (y/n) \n";
cin>>opt;
if(opt=='y')
{
clrscr();
gotoxy(33,13);
cout<<"thank you";
getch();
exit(0);
}
break;
}
default:
{
cout<<"enter a valid option";
getch();
} // close of switch
} while(1); //close of do while
} // close of function
void disp_period()
{
clrscr();
ifstream fin("period.dat",ios::binary|ios::in);
if(!fin)
cout<<"error";
cout<<"\t\t\t the modern periodic table";
while(!fin.eof())
{
if(fin.eof())
break;
fin.read((char*)&e,sizeof(element));
gotoxy(4*e.ret_group()),(e.ret_period+5));
cout<<e.sym();
}
fin.close();
getch();
}
void search()
{
char ch;
int result=0; //for checking success of search
do
{
result=0;
clrscr();
cout<<"\t\t\tthe periodic table\n\n";
cout<<"\t\tsearch modes available \n\n";
cout<<"1.element symbol\n";
cout<<"2.element name\n";
cout<<"3.atomic number\n";
cout<<"4.return to main memory\n";
cout<<"your choice:";
cin>>ch;
ifstream a("period.dat",ios::binary);
if(!a)
cout<<"error";
switch(ch)
{
case '1':
{
char symbol[3];
cout<<"enter the elements symbol\n";
gets(symbol);
while(!(a.eof()))
{
if((a.eof()))
break;
a.read((char*)&e,sizeof(element));
if(strcmpi(e.sym(),symbol)==0)
{
e.output();
report(e,'s'); //for sending result of search to report()
getch();
result=1;
break;
}
}
a.close();
break;
}
case '2':
{
char name[20];
cout<<"enter the elements name\n";
gets(name);
while(!a.eof())
{
if(a.eof())
break;
a.read((char*)&e,sizeof(element));
if(strcmpi(e.nam(),name)==0)
{
e.output();
report(e,'s');
getch();
result=1;
break;
}
}
a.close();
break;
}
case'3':
{
int atno;
cout<<"enter the elements atomic no.\n";
cin>>atno;
while(!(a.eof()))
{
if((a.eof()))
break;
a.read((char*)&e,sizeof(element));
if(e.atno()==atno)
{
e.output();
report(e,'s');
getch();
result=1;
break;
}
}
a.close();
break;
}
case '4' : return; //no need break as the control is passed on,
//fall through does not occur
default:
{
cout<<"enter a valid option";
getch();
}
}
if(!result)
{
cout<<"sorry, no entry found";
getch();
}
}while(1);
}
void period_det()
{
int presence; // for checking presence of element in database
char ch;
do
{
presence=0;
clrscr();
cout<<"\t\tperiodic table details \n\n";
cout<<"1. add element \n";
cout<<"2. modify element\n";
cout<<"3. display periodic table\n";
cout<<"4. return to main menu\n";
cout<<"enter your choice : ";
cin>>ch;  
 
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
switch(ch)
{
case '1' :
{
if(access)
{
element e3;
e.input();
ifstream a("period.dat",ios::binary);
if(!a)
cout<<"error";
a.seekg(0);
while(!a.eof())
{
if(a.eof())
break;
a.read((char*)&e3,sizeof(element));
if(strcmpi(e3.sym(),e.sym())==0) || (strcmpi(e3.nam(),e.nam())==0) || (e3.atno()==e.atno()) || ((e3.ret_period))==e.ret_period())&&(e3.ret_group()==e.ret_group())) || (e3.massno()==e.massno())
{e3.output();presence=1;break;}
}
a.close();
if(!presence)
{
ofstream b("period.dat",ios::binary|ios::app);
if(!b)
cout<<"error";
b.write((char*)&e,sizeof(element));
cout<<"element added\n";
getch();
b.close();
report(e,'u');
}
else
{
cout<<"element already present";
getch();
}
break;
}
else
{
clrscr();
cout<<"access denied";
getch();
break;
}
}
case '2' :
{
if(access)
{
int result=0;
char ele_name[20];
cout<<"enter name of element to be modified\n";
gets(ele_name);
fstream f("period.dat",ios::binary|ios::in|ios::out);
if(!f)
cout<<"error";
f.seekg(0);
while(!f.eof())
{
if(f.eof())
break;
f.read((char*)&e,sizeof(element));
if(strcmpi(ele_name,e.nam())==0)
{
result=1;
char choice;
e.output();
cout<<"do you want to modify this record(y/n)";
cin>>ch;
if(ch=='y'||ch=='y')
{
f.seekp(f.tellg()-(sizeof(element)));
e.input();
ifstream g("period.dat",ios::binary);
if(!g)
cout<<"error";
element h;
int unique =1;
while(!g.eof())
{
if(g.eof())
break;
g.read((char*)&h,sizeof(element));
if((strcmpi(h.sym(),e.sym())==0) || (strcmpi(h.nam(),e.nam())==0) || (h.atno()==e.atno())
|| (h.ret_period()==e.ret_period()0&&(h.ret_group()==e.ret_group())) || (h.massno()==e.massno()))
{unique=0;
cout<<"element with modified data exists\n";
h.output();
getch();
break;
}
}
if(unique)
{f.write((char*)&e,sizeof(element));
report(e,'u');
cout<<"record edited";
getch();
}
break;
}
}
}
if(!result())
cout<<"no such record found";
getch();
f.close();
break;
}
else {
clrscr();
cout<<"access denied";
getch();
break;
}
}
case '3':
{
disp_period();
break;
}
case '4':
{
return;
}
default:
cout<<"enter a valid option";
getch();
}
}while(1);
}
void report(element e,char type)
{
if(type=='s')
{
report_s=1;
ofstream fout("reportsearch.dat",ios::binary|ios::app);
if(!fout)
cout<<"error";
else
fout.write((char*)&e,sizeof(element));
fout.close();
}
}
void report()
{
ifstream fin("reportsearch.dat",ios::binary);
if(!fin)
cout<<"error";
else
{
if(report_s)
{
clrscr();
cout<<"\tsearch report\n";
while(!fin.eof())
{
fin.read((char*)&e,sizeof(element));
if(fin.eof())
break;
e.output();
getch();
}
fin.close();
cout<<"end of search report";
getch();
}
else
{
clrscr();
cout<<"no search report found\n";
getch();
{
if(access)
{
if(report_u)
{
ifstream fin("reportupdate.dat",ios::binary);
if(!fin)
cout<<"error";
else
{
clrscr();
cout<<"\tupdate report\n";
while(!fin.eof())
{
fin.read((char*)&e,sizeof(element));
if(fin.eof())
break;
e.output();
getch();
}
fin.close();
cout<<"end of update report";
getch();
}
}
else {
clrscr();
cout<<"no update report found";
getch();
}
}
}
}
void main()
{
ofstream z("reportsearch.dat",ios::binary|ios::trunc);
if(!z)
cout<<"error";
z.close();
ofstream y("reportupdate.dat",ios::binary|ios::trunc);
if(!y)
cout<<"error";
y.close();
clrscr();
highvideo();
char ch;
gotoxy(25,12);
highvideo();
cout<<"welcome to the periodic table\n";
getch();
login();
do
{
clrscr();
cout<<"\t"<<"\t"<<"the periodic table\n\n";
cout<<"1. periodic table details\n";
cout<<"2. search for element \n";
cout<<"3. report\n";
cout<<"4.switch user\n";
cout<<"5. quit\n";
cout<<" enter you choice";
cin>>ch;
switch(ch)
{
case '1': period_det(); break;
case '2': search(); break;
case '3': report(); break;
case '4': login(); break;
case '5': clrscr();
char opt;
cout<<"are you sure?? (y/n) \n";
cin>>opt;
if(opt=='y')
{
clrscr();
gotoxy(33,13);
cout<<"thank you";
getch();
exit(0);
}
break;
default:cout<<"enter a valid option";
getch();
}
}while(1);
}
Topic archived. No new replies allowed.