?? hospital sys01.cpp
字號:
//**************************************
// Name: hospital DBMS
// Description:It is supposed to be hospital DBMS
I'll be improving it within a few months with pasword security
// By: sidharth sreekumar
//
//
// Inputs:Read the help
//
// Returns:None
//
//Assumes:None
//
//Side Effects:It seems to run perfectly on my comp but screws up on some others
//This code is copyrighted and has limited warranties.
//Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.10078/lngWId.3/qx/vb/scripts/ShowCode.htm
//for details.
//**************************************
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<fstream.h>
#include<string.h>
#include<stdlib.h>
#include<process.h>
#include<dos.h>
///////////base class that keeps track of no. of records//////////////
class hospital
{
public:
long int n;
};
/////////keeps record of patient in hopital///////////////////
class patient:public hospital
{
char name[20],disease[30],cond[20],doctor[20],ward[20],status[20];
int adays,bed;
long float bill;
public:
void inp1();
void out1();
void out3();
int search(char[20],int);
int diset(int,int);
};
////////////keeps record of patient address and history////////////
class addr:public hospital
{
char hno[10],col[20],city[20],state[20],country[20],history[50];
long long int zip;
public:
void addrset();
void addrnull();
void view();
};
char* dis(char *d);
void out2();
void inp2();
int count();
void modify(int);
void del(int);
void box();
void box(int);
void dismenu(int);
void addrd(long int);
void modifya(long int);
long float billset(int,int,int,int);
void searchmain();
void help();
void menu();
void intro();
void saveload(int);
void main()
{
clrscr();
intro();
menu();
}
////////////inputs data into class 'patient'///////////
void patient::inp1()
{
fstream ad;
addr a;
int r,c,di,s,w,x=4;
char a1;
randomize();
bed=rand()%50;
adays=bill=0;
cout<<"\n\n\n\t\t\tEnter name(char): ";
box(13);
gotoxy(43,x);
gets(name);
label1:cout<<"\t\t\tEnter illness(int): ";
dismenu(1);
box(13);
gotoxy(45,++x);
cin>>di;
diset(di,1);
if(diset(di,1)==1)
goto label1;
label2:cout<<"\t\t\tEnter condition of patient(int): ";
dismenu(2);
box(13);
gotoxy(59,++x);
cin>>s;
diset(s,2);
if(diset(s,2)==1)
goto label2;
label3:cout<<"\t\t\tStatus Classification(1.priority 1 / 2.public): ";
dismenu(4);
box(13);
gotoxy(72,++x);
cin>>c;
if(c==1)
strcpy(status,"priority 1");
else if(c==2)
strcpy(status,"public");
else
goto label3;
int d=strcmp(cond,"dead");
if(d==0)
{
cout<<"\t\t\tEnter days admitted(int): ";
box(13);
gotoxy(51,++x);
cin>>adays;
strcpy(doctor,"NA");
strcpy(ward,"morgue");
}
if(d!=0)
{
strcpy(doctor,dis(disease));
cout<<"\t\t\tEnter days admitted(int): ";
box(13);
gotoxy(51,++x);
cin>>adays;
cout<<"\t\t\tEnter ward(int):";
box(13);
dismenu(3);
gotoxy(42,++x);
cin>>w;
diset(w,3);
}
bill=billset(adays,di,s,w);
};
////////////outputs data from class 'patient'///////////
void patient::out1()
{
char a;
fstream o;
addr ad;
cout<<"\n\n\n\t\t\tRecord No.: "<<n<<endl;
cout<<"\t\t\tRecord Status: ";
puts(status);
cout<<"\t\t\tName: ";
puts(name);
cout<<"\t\t\tDisease: ";
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -