Beruflich Dokumente
Kultur Dokumente
™P10,HOSPITAL,MANAGEMENT,1Password,Protected,S
Login
Code/Articles
Newest
Browse categories
Search
-----------------------
-----------------------
Recommended reading
Top Code
Coding contest
-----------------------
Community
Ask a pro discussion forum
Other
My profile
How to link to us
Awards/Reviews/Raves!
Advertising/Media kit
Feedback
Goto…
C/ C++ home
Site home
VB icon
Level: Intermediate
Views: 10545
author picture
code:
//**************************************
//Developed By Sankalp
/*Features:
4.System Shuts Down When The User Enters Wrong Password Too Many Times
Note:-My First C++ Project for building a hospital management system for my college lab
assignment..It may not be a perfect one as it is my first project..I worked hard to come up with a
good one in limited time..hope u like it :):):)
//**************************************
//P10 HOSPITAL MANAGEMENT SYSTEM
//Developed By Sankalp
/*Features:
4.System Shuts Down When The User Enters Wrong Password Too Many Times
*/
#include<iostream>
#include<conio.h>
#include<fstream>
#include<string>
class password
string code;
public:
void get_password();
int verify_password(string);
};
void password::get_password()
{
cout << "Setting Up The P10 Hospital Management System.....\n";
START:
code.clear();
char ch;
int count = 0;
ch = _getch();
if (ch == 8)
code.pop_back();
if (ch != 8)
code.push_back(ch);
ch = _getch();
count++;
if (count < 5)
goto START;
if (pass == code)
return(1);
class doctor
int id;
int code;
char name[50];
int age;
char qualification[10];
char specilization[10];
int experience;
char state[50];
char city[50];
public:
int get_ID();
void get_info();
void get_name();
void get_age();
void get_code();
void get_qualification();
void get_specilization();
void get_experience();
void get_state();
void get_city();
};
void add_doctor_data();
void modify_doctor_data();
void delete_contents();
void delete_contents1();
void display();
void delete_doctor_data();
int display_doctor_data();
int doctor_number();
int i = 0;
for (i = 0; i < size; i++)
if (isdigit(arr[i]))
return(1);
int doctor_number()
size = get_size_of_the_file();
doctor d;
return(size);
if (opt == code)
flag++;
return(flag);
else
{
return(flag);
int doctor::get_ID()
return(id);
void doctor::get_info()
NAME:
cin.ignore();
cin.getline(name, 50);
int flag;
int size=strlen(name);
flag=verify_alphabet(name,size);
if (flag == 1)
system("PAUSE");
goto NAME;
}
QUALIFICATION:
cin.ignore();
cin.getline(qualification, 50);
size = strlen(qualification);
if (flag == 1)
system("PAUSE");
goto QUALIFICATION;
SPECILIZATION:
cin.getline(specilization, 50);
size = strlen(specilization);
if (flag == 1)
system("PAUSE");
goto SPECILIZATION;
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
STATE:
cin.ignore();
cin.getline(state, 30);
size = strlen(state);
if (flag == 1)
{
system("PAUSE");
goto STATE;
CITY:
cin.getline(city, 30);
size = strlen(city);
if (flag == 1)
cout << "\nCity should consist of only alphabets!!! or min of three alphabets\n";
system("PAUSE");
goto CITY;
void doctor::get_name()
NAME:
cin.ignore();
if (flag == 1)
system("PAUSE");
goto NAME;
void doctor::get_age()
cin.ignore();
void doctor::get_qualification()
QUALIFICATION:
cin.ignore();
int flag;
if (flag == 1)
system("PAUSE");
goto QUALIFICATION;
void doctor::get_specilization()
SPECILIZATION:
cin.ignore();
int flag;
if (flag == 1)
system("PAUSE");
goto SPECILIZATION;
}
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
void doctor::get_experience()
cin.ignore();
void doctor::get_state()
STATE:
cin.ignore();
int flag;
int size = strlen(state);
if (flag == 1)
system("PAUSE");
goto STATE;
void doctor::get_city()
CITY:
cin.ignore();
int flag;
if (flag == 1)
system("PAUSE");
goto CITY;
}
void doctor::display_info(doctor d)
void doctor::display_all(doctor d)
cout <<"\t"<< d.id << "\t\t" << d.specilization << "\t\t\t" << d.qualification << "\t\t\t" <<
d.age<<"\n";
if (number == 1)
fstream myfile6("doctor8.txt",ios::in|ios::out);
doctor d1 = d;
d1.get_name();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&d1, sizeof(d1));
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 2)
fstream myfile6("doctor8",ios::in|ios::out);
doctor d1 = d;
d1.get_age();
myfile6.seekp(size,ios::beg);
myfile6.write((char*)&d1, sizeof(d1));
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 3)
{
doctor d1 = d;
d1.get_qualification();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&d1, sizeof(d1));
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 4)
doctor d1 = d;
d1.get_specilization();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&d1, sizeof(d1));
system("PAUSE");
system("CLS");
myfile6.close();
cout << "\n";
system("PAUSE");
else if (number == 5)
doctor d1 = d;
d1.get_experience();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&d1, sizeof(d1));
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 6)
doctor d1 = d;
d1.get_state();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&d1, sizeof(d1));
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 7)
doctor d1 = d;
d1.get_city();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&d1, sizeof(d1));
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
class patient
int id;
int doc_id;
char name[50];
int age;
char occupation[30];
char state[10];
char symptoms[70];
char disease[50];
char city[10];
char consultation_date[30];
char nationality[20];
char phone_no[20];
char street[30];
char door_no[20];
char condition[30];
char date_admitted[20];
char date_discharged[20];
char discharge_condition[50];
int bill;
public:
int get_ID();
void set_doc_ID();
void get_info();
void get_name();
void get_age();
void get_occupation();
void get_state();
void get_city();
void get_phone_no();
void get_nationality();
void get_street();
void get_door_no();
void get_condition();
void report1(patient);
void get_discharge_condition();
void get_date_admitted();
void get_date_discharged();
void get_bill();
void bill1(patient);
};
void add_patient_data();
void modify_patient_data();
void delete_patient_data();
void assign_patient();
void display1();
void report();
void bill();
int display_patient_data();
int number();
void patient::bill1(patient p)
system("CLS");
int total;
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
*";
cout <<
"******************************************************************************
**";
void patient::report1(patient p)
system("CLS");
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
cout << "\nPatient Condition At The Time Of Discharge :" << p.discharge_condition;
cout <<
"******************************************************************************
**";
int patient::get_ID()
return(id);
void patient::set_doc_ID()
void patient::get_info()
NAME:
cin.ignore();
cin.getline(name, 50);
int flag;
if (flag == 1)
system("PAUSE");
goto NAME;
OCCUPATION:
cin.ignore();
cin.getline(occupation, 30);
size = strlen(occupation);
if (flag == 1)
system("PAUSE");
goto OCCUPATION;
STATE:
cin.getline(state, 30);
size = strlen(state);
if (flag == 1)
system("PAUSE");
goto STATE;
CITY:
size = strlen(city);
if (flag == 1)
system("PAUSE");
goto CITY;
NATIONALITY:
cin.getline(nationality, 30);
size = strlen(nationality);
if (flag == 1)
system("PAUSE");
goto NATIONALITY;
cin.getline(phone_no, 20);
cout << "\nEnter Patient's Street Name :";
cin.getline(street, 30);
cin.getline(symptoms, 70);
cin.getline(disease, 30);
cin.getline(door_no, 20);
cin.getline(condition, 30);
cin.getline(date_admitted, 20);
cin.getline(date_discharged, 20);
cout << "\nEnter Condition Of The Patient At The Time Of The Discharge :";
cin.getline(discharge_condition, 50);
cin.getline(consultation_date, 30);
ifstream myfile1("doctor8.txt");
size = get_size_of_the_file();
doctor d;
cout <<
"******************************************************************************
**";
cout << "\n\t The Following Are The Specilizations Available In The Hospital\n";
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
int opt,flag=0;
int cho;
myfile1.seekg(0);
switch (opt)
case 1:
system("CLS");
cout <<
"******************************************************************************
**";
cout << "\n\t\tID's Of The Doctors With The General Medicine Specilization\n";
cout <<
"******************************************************************************
**";
myfile1.read((char*)&d, sizeof(d));
flag = d.verify_specilization(opt,flag);
myfile1.close();
if (flag == 0)
system("CLS");
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
system("PAUSE");
else
cout <<
"******************************************************************************
*****";
patient p1 = p;
myfile6.seekp(0);
myfile6.seekg(0);
p1.set_doc_ID();
myfile6.seekp(size1, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
system("CLS");
cout <<
"\n****************************************************************************
*";
system("PAUSE");
break;
case 2:
system("CLS");
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
myfile1.read((char*)&d, sizeof(d));
flag = d.verify_specilization(opt,flag);
if (flag == 0)
system("CLS");
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
system("PAUSE");
else
cout <<
"******************************************************************************
**";
patient p1 = p;
myfile6.seekp(0);
myfile6.seekg(0);
p1.set_doc_ID();
myfile6.seekp(size1, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
system("CLS");
cout <<
"\n****************************************************************************
*";
system("PAUSE");
break;
case 3:
system("CLS");
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
myfile1.read((char*)&d, sizeof(d));
flag = d.verify_specilization(opt,flag);
}
if (flag == 0)
system("CLS");
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
system("PAUSE");
else
cout <<
"******************************************************************************
**";
patient p1 = p;
myfile6.seekp(0);
myfile6.seekg(0);
p1.set_doc_ID();
myfile6.seekp(size1, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
system("CLS");
cout <<
"\n****************************************************************************
*";
system("PAUSE");
break;
case 4:
system("CLS");
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
myfile1.read((char*)&d, sizeof(d));
flag = d.verify_specilization(opt,flag);
if (flag == 0)
{
system("CLS");
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
system("PAUSE");
else
cout <<
"******************************************************************************
**";
patient p1 = p;
myfile6.seekp(0);
myfile6.seekg(0);
p1.set_doc_ID();
myfile6.seekp(size1, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
system("CLS");
system("PAUSE");
break;
default:
void patient::get_name()
cin.ignore();
cin.getline(name, 50);
void patient::get_age()
cin.ignore();
void patient::get_occupation()
cin.getline(occupation, 50);
void patient::get_state()
cin.ignore();
cin.getline(state, 20);
void patient::get_city()
cin.ignore();
cin.getline(city, 20);
void patient::get_phone_no()
cin.ignore();
cin.getline(phone_no, 30);
void patient::get_nationality()
cin.ignore();
void patient::get_street()
cin.ignore();
cin.getline(street, 50);
void patient::get_door_no()
cin.ignore();
cin.getline(door_no, 30);
void patient::get_condition()
cin.ignore();
cin.getline(condition, 50);
void patient::get_discharge_condition()
cin.ignore();
cout << "\nEnter New Condition Of The Patient At The Time Of Discharge :";
cin.getline(discharge_condition, 50);
}
void patient::get_date_admitted()
cin.ignore();
cin.getline(date_admitted, 30);
void patient::get_date_discharged()
cin.ignore();
cin.getline(date_discharged, 30);
}void patient::get_bill()
cin.ignore();
void patient::display_all(patient p)
cout << p.id << "\t" << p.age << "\t" << p.symptoms << "\t" << p.date_admitted <<
"\t\t\t"<<p.doc_id<<"\n";
void patient::display_info(patient p)
cout << "\nID Of The Doctor Who Is Treating The Patient:" << p.doc_id;
if (number == 1)
patient p1 = p;
p1.get_name();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 2)
patient p1 = p;
p1.get_age();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
}
else if (number == 3)
patient p1 = p;
p1.get_occupation();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 4)
patient p1 = p;
p1.get_state();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
int total = myfile6.tellp();
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 5)
patient p1 = p;
p1.get_city();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
else if (number == 6)
patient p1 = p;
p1.get_phone_no();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 7)
patient p1 = p;
p1.get_nationality();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
else if (number == 8)
patient p1 = p;
p1.get_street();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
cout << "\n";
system("PAUSE");
else if (number == 9)
patient p1 = p;
p1.get_door_no();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
patient p1 = p;
p1.get_condition();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
patient p1 = p;
p1.get_discharge_condition();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
system("PAUSE");
patient p1 = p;
p1.get_date_admitted();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
patient p1 = p;
p1.get_date_discharged();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
myfile6.close();
system("PAUSE");
patient p1 = p;
p1.get_bill();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
total /= sizeof(p1);
system("PAUSE");
system("CLS");
cout << "\nData Successfully Modified\n";
myfile6.close();
system("PAUSE");
void main()
password p;
p.get_password();
system("CLS");
START1:
system("CLS");
cout <<
"******************************************************************************
**\n";
cout <<
"******************************************************************************
**\n";
cout <<
"******************************************************************************
**\n";
int op,ch,count=0,x;
char c;
string pass;
system("PAUSE");
START3:
switch (op)
case 1:
system("CLS");
cout <<
"******************************************************************************
**\n";
cout <<
"******************************************************************************
**\n";
cout <<
"******************************************************************************
**";
switch (ch)
{
case 1:
system("CLS");
START2:
count++;
cout << "\nPlease Enter Your Password To Enter Into This Database :";
pass.clear();
c = _getch();
while (c != 13)
if (c == 8)
pass.pop_back();
if (c != 8)
pass.push_back(c);
c = _getch();
x = p.verify_password(pass);
if (x == 1)
{
cout << "\n\nAccess Granted ";
system("PAUSE");
system("CLS");
while (1)
system("CLS");
cout <<
"******************************************************************************
**\n";
cout <<
"\n****************************************************************************
****\n";
cout <<
"\n****************************************************************************
****\n";
int opt;
int y;
switch (opt)
case 1:
system("CLS");
add_doctor_data();
break;
case 2:
system("CLS");
modify_doctor_data();
break;
case 3:
system("CLS");
y = display_doctor_data();
if (y != 1)
system("PAUSE");
break;
case 4:
system("CLS");
delete_doctor_data();
system("PAUSE");
break;
case 5:
system("CLS");
system("PAUSE");
break;
case 6:
system("CLS");
delete_contents();
system("PAUSE");
break;
case 7:
system("CLS");
display();
cout << "\n\n";
system("PAUSE");
break;
case 8:
system("CLS");
goto START3;
_getch();
else
if (count >= 3)
system("CLS");
system("PAUSE");
exit(0);
goto START2;
}
case 2:
system("CLS");
START4:
count++;
cout << "\nPlease Enter Your Password To Enter Into This Database :";
pass.clear();
c = _getch();
while (c != 13)
if (c == 8)
pass.pop_back();
if (c != 8)
pass.push_back(c);
c = _getch();
x = p.verify_password(pass);
if (x == 1)
{
cout << "\n\nAccess Granted ";
system("PAUSE");
system("CLS");
while (1)
system("CLS");
cout <<
"******************************************************************************
**\n";
cout <<
"******************************************************************************
**\n";
cout <<
"******************************************************************************
**\n";
int opt;
cout << "\nPlease Choose Your Choice :";
int y;
switch (opt)
case 1:
system("CLS");
add_patient_data();
break;
case 2:
system("CLS");
assign_patient();
break;
case 3:
system("CLS");
modify_patient_data();
break;
case 4:
system("CLS");
y = display_patient_data();
if (y != 1)
system("PAUSE");
}
break;
case 5:
system("CLS");
delete_patient_data();
system("PAUSE");
break;
case 6:
system("CLS");
system("PAUSE");
break;
case 7:
system("CLS");
delete_contents1();
system("PAUSE");
break;
case 8:
system("CLS");
display1();
cout << "\n\n";
system("PAUSE");
break;
case 9:
system("CLS");
goto START3;
_getch();
else
if (count >= 3)
system("CLS");
system("PAUSE");
exit(0);
goto START4;
}
case 3:
system("CLS");
report();
system("PAUSE");
goto START3;
break;
case 4:
system("CLS");
bill();
system("PAUSE");
system("CLS");
goto START3;
break;
case 5:
goto START1;
default:
}
break;
case 2:
exit(0);
break;
default:
_getch();
void add_doctor_data()
doctor d;
ofstream myfile("doctor8.txt",ios::in|ios::app);
d.get_info();
myfile.write((char*)&d, sizeof(d));
myfile.close();
void display()
size = get_size_of_the_file();
int i = 0;
doctor d;
else
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
cout <<"\t"<< "ID" << "\t\t" << "Specilization" << "\t\t" <<
"Qualification" << "\t\t" << "Age" << "\n";
ifstream myfile("doctor8.txt");
myfile.seekg(0);
myfile.read((char*)&d, sizeof(d));
d.display_all(d);
cout <<
"******************************************************************************
**";
}
int display_doctor_data()
size = get_size_of_the_file();
doctor d1;
if (size == 0)
else
ifstream myfile1("doctor8.txt");
myfile1.clear();
myfile1.read((char*)&d1, sizeof(d1));
id1 = d1.get_ID();
if (id == id1)
{
count = 1;
d1.display_info(d1);
system("PAUSE");
break;
myfile1.close();
return(count);
void modify_doctor_data()
int id1;
size = get_size_of_the_file();
doctor d2;
if (size == 0)
{
cout << "\nDatabase Empty!!!\n";
system("PAUSE");
else
ifstream myfile2("doctor8.txt");
myfile2.clear();
myfile2.read((char*)&d2, sizeof(d2));
id = d2.get_ID();
if (id == id1)
size = myfile2.tellg();
count = 1;
d2.display_info(d2);
system("PAUSE");
int opt2;
switch (opt2)
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
case 7:
break;
default:
break;
myfile2.close();
if (count == 0)
system("PAUSE");
void delete_contents()
ofstream myfile("doctor8.txt");
myfile.close();
void delete_contents1()
{
ofstream myfile("patient11.txt");
myfile.close();
void delete_doctor_data()
size = get_size_of_the_file();
doctor d;
if (size == 0)
else
ifstream myfile6("doctor8.txt");
ofstream myfile7("temp1.txt");
cout << "\nEnter The ID Of The Doctor Whose Data You Want To
Delete :";
myfile6.read((char*)&d, sizeof(d));
id1 = d.get_ID();
if (id != id1)
myfile7.write((char*)&d, sizeof(d));
else
count = 1;
myfile6.close();
myfile7.close();
ofstream myfile9("doctor8.txt");
ifstream myfile8("temp1.txt");
myfile8.read((char*)&d, sizeof(d));
myfile9.write((char*)&d, sizeof(d));
if (count == 0)
else
ifstream ifile("doctor8.txt");
ifile.seekg(0, ios::end);
size = ifile.tellg();
ifile.close();
return(size);
void add_patient_data()
patient p;
p.get_info();
myfile.write((char*)&p, sizeof(p));
myfile.close();
void display1()
size = get_size_of_the_file1();
int i = 0;
patient p;
if (size == 0)
else
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
cout << "ID" << "\t" << "Age" << "\t" << "Illness" << "\t\t" << "Date
Admitted" << "\t\t"<<"Doctor's ID"<<"\n";
ifstream myfile("patient11.txt");
myfile.seekg(0);
myfile.read((char*)&p, sizeof(p));
p.display_all(p);
cout <<
"******************************************************************************
**";
int display_patient_data()
size = get_size_of_the_file1();
patient p1;
if (size == 0)
}
else
ifstream myfile1("patient11.txt");
myfile1.clear();
myfile1.read((char*)&p1, sizeof(p1));
id1 = p1.get_ID();
if (id == id1)
count1 = 1;
p1.display_info(p1);
system("PAUSE");
break;
myfile1.close();
return(count1);
}
void assign_patient()
patient p;
int id;
size = get_size_of_the_file1();
if (size == 0)
system("PAUSE");
else
ifstream myfile("patient11.txt");
myfile.seekg(0);
myfile.read((char*)&p, sizeof(p));
id1 = p.get_ID();
if (id == id1)
count = 1;
size = myfile.tellg();
p.assign_patient_to_doctor( p, size);
break;
if (count == 0)
system("CLS");
cout <<
"******************************************************************************
**";
cout <<
"******************************************************************************
**";
system("PAUSE");
}
void modify_patient_data()
int id1;
size = get_size_of_the_file1();
patient p2;
if (size == 0)
system("PAUSE");
else
ifstream myfile2("patient11.txt");
myfile2.seekg(0);
myfile2.read((char*)&p2, sizeof(p2));
id = p2.get_ID();
if (id == id1)
size = myfile2.tellg();
count = 1;
p2.display_info(p2);
system("PAUSE");
int opt2;
switch (opt2)
case 1:
break;
case 2:
p2.modify_info(p2, opt2, size);
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
case 10:
case 11:
break;
case 12:
break;
case 13:
break;
case 14:
break;
default:
break;
myfile2.close();
if (count == 0)
system("PAUSE");
}
void delete_patient_data()
size = get_size_of_the_file1();
patient p;
if (size == 0)
else
ifstream myfile6("patient11.txt");
ofstream myfile7("temp4.txt");
cout << "\nEnter The ID Of The Patient Whose Data You Want To
Delete :";
myfile6.read((char*)&p, sizeof(p));
id1 = p.get_ID();
if (id != id1)
myfile7.write((char*)&p, sizeof(p));
else
count = 1;
myfile6.close();
myfile7.close();
ofstream myfile9("patient11.txt");
ifstream myfile8("temp4.txt");
myfile8.read((char*)&p, sizeof(p));
myfile9.write((char*)&p, sizeof(p));
if (count == 0)
}
else
ifstream ifile("patient11.txt");
ifile.seekg(0, ios::end);
size = ifile.tellg();
ifile.close();
return(size);
int number()
patient p;
size = get_size_of_the_file1();
void report()
patient p;
size = get_size_of_the_file1();
if (size == 0)
system("PAUSE");
else
ifstream myfile1("patient11.txt");
myfile1.clear();
myfile1.read((char*)&p, sizeof(p));
id1 = p.get_ID();
if (id == id1)
count = 1;
p.report1(p);
break;
if (count == 0)
void bill()
size = get_size_of_the_file1();
patient p1;
if (size == 0)
else
ifstream myfile1("patient11.txt");
myfile1.clear();
myfile1.read((char*)&p1, sizeof(p1));
id1 = p1.get_ID();
if (id == id1)
count1 = 1;
p1.bill1(p1);
break;
if (count1 == 0)
myfile1.close();
}
}
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Your Vote
(The code with your highest vote will win this month's coding contest!)
Excellent Good Average Below Average Poor (See voting log ...)
im a beginner
Your feedback will be posted below and an email sent to the author. Please remember that the
author was kind enough to share this with you, so any criticisms must be stated politely, or they
will be deleted. (For feedback not related to this particular code, please click here instead.)
Search:
libcont-3.17
By MaximumMunch on 1/15
(Screen Shot)
By Thomas1965 on 10/20
Click here to see a screenshot of this code!
By mhcrnl on 10/1
(Screen Shot)
By mhcrnl on 9/29
(Screen Shot)
By mhcrnl on 9/27
(Screen Shot)
C tinyFileDialogs Example
By mhcrnl on 9/27
(Screen Shot)
Click here to see a screenshot of this code!
C Console Phonebook
By mhcrnl on 9/27
(Screen Shot)
By mhcrnl on 9/27
(Screen Shot)
By mhcrnl on 9/27
(Screen Shot)
C Phonebook Project
By mhcrnl on 9/26
(Screen Shot)
By mhcrnl on 9/26
(Screen Shot)
By mhcrnl on 9/25
(Screen Shot)
By mhcrnl on 9/25
(Screen Shot)
By mhcrnl on 9/25
(Screen Shot)
(Screen Shot)
By Thomas1965 on 9/17
(Screen Shot)
By Jeimy RM on 7/27
(Screen Shot)
(Screen Shot)
(Screen Shot)
CG Program
(Screen Shot)
Printer names
By Thomas1965 on 1/26
This site on CD
Code/Articles
Newest
Browse categories
Search
Recommended reading
Top Code
Coding contest
Community
Other
My profile
How to link to us
Awards/Reviews/Raves!
Advertising/Media kit
Feedback
Goto…
C/ C++ home
Site home
By using this site you agree to its Terms and Conditions. Planet Source Code™ and the phrase
"Dream It. Code It"™ are trademarks of Exhedra Solutions, Inc.
My nonprogramming sites: The Real Estate Crowdfunding Review: Investing tools that cut
through the clutter and the hype. Real information and reviews. Real-time investment feeds.
Real profitable. | Dollar candy: Play 60 second puzzles against three other people for real
money! Legal in 36 states and overseas.