SlideShare a Scribd company logo
1 of 15
Download to read offline
As usual a large number of people deserve my
thanks for the help they provided me for the
preparation of this project.
First of all I would like
to thank my teacher MR. N.G.B Singh Sir for his
support during the preparation of this project. I
am very thankful for his guidance.
I would also like
to thank my friends for the encouragement and
information about the topic they provided to me
during my efforts to prepare this topic.
At last but not the least I would like to thank
seniors for providing me their experience and being
with me during my work.
//Hospital management database - Project Program for Hospital
Database Queue array.
//**************HEADER FILE USED******************************
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
// define maximum number of patients in a queue
#define MAXPATIENTS 100
// define structure for patient data
struct patient
{
char FirstName[50];
char LastName[50];
char ID[20];
};
// define class for queue
class queue
{
public:
queue (void);
int AddPatientAtEnd (patient p);
int AddPatientAtBeginning (patient p);
patient GetNextPatient (void);
int RemoveDeadPatient (patient * p);
void OutputList (void);
char DepartmentName[50];
private:
int NumberOfPatients;
patient List[MAXPATIENTS];
};
// declare member functions for queue
queue::queue ()
{
// constructor
NumberOfPatients = 0;
}
int queue::AddPatientAtEnd (patient p)
{
// adds a normal patient to the end of the queue.
// returns 1 if successful, 0 if queue is full.
if (NumberOfPatients >= MAXPATIENTS)
{
// queue is full
return 0;
}
// put in new patient
else
List[NumberOfPatients] = p; NumberOfPatients++;
return 1;
}
int queue::AddPatientAtBeginning (patient p)
{
// adds a critically ill patient to the beginning of the queue.
// returns 1 if successful, 0 if queue is full.
int i;
if (NumberOfPatients >= MAXPATIENTS)
{
// queue is full
return 0;
}
// move all patients one position back in queue
for (i = NumberOfPatients-1; i >= 0; i--)
{
List[i+1] = List[i];
}
// put in new patient
List[0] = p; NumberOfPatients++;
return 1;
}
patient queue::GetNextPatient (void)
{
// gets the patient that is first in the queue.
// returns patient with no ID if queue is empty
int i; patient p;
if (NumberOfPatients == 0) {
// queue is empty
strcpy(p.ID,"");
return p;}
// get first patient
p = List[0];
// move all remaining patients one position forward in queue
NumberOfPatients--;
for (i=0; i<NumberOfPatients; i++)
{
List[i] = List[i+1];
}
// return patient
return p;
}
int queue::RemoveDeadPatient (patient * p)
{
// removes a patient from queue.
// returns 1 if successful, 0 if patient not found
int i, j, found = 0;
// search for patient
for (i=0; i<NumberOfPatients; i++)
{
if (stricmp(List[i].ID, p->ID) == 0)
{
// patient found in queue
*p = List[i]; found = 1;
// move all following patients one position forward in
queue
NumberOfPatients--;
for (j=i; j<NumberOfPatients; j++)
{
List[j] = List[j+1];
}
}
}
return found;
}
void queue::OutputList (void)
{
// lists entire queue on screen
int i;
if (NumberOfPatients == 0)
{
cout << "Queue is empty";
}
else
{
for (i=0; i<NumberOfPatients; i++)
{
cout << " " << List[i].FirstName;
cout << " " << List[i].LastName;
cout << " " << List[i].ID;
}
}
}
// declare functions used by main:
patient InputPatient (void)
{
// this function asks user for patient data.
patient p;
cout << "Please enter data for new patient"<<"n First name: ";
cin.getline(p.FirstName, sizeof(p.FirstName));
cout << "nLast name: ";
cin.getline(p.LastName, sizeof(p.LastName));
cout << "nSocial security number: ";
cin.getline(p.ID, sizeof(p.ID));
// check if data valid
if (p.FirstName[0]==0 || p.LastName[0]==0 || p.ID[0]==0)
{
// rejected
strcpy(p.ID,"");
cout << "nError: Data not valid. Operation cancelled.";
getch();
}
return p;
}
void OutputPatient (patient * p)
{
// this function outputs patient data to the screen
if (p == NULL || p->ID[0]==0)
{
cout << "nNo patient";
return;
}
else
cout << "nPatient data:";
cout << "nFirst name: " << p->FirstName;
cout << "nLast name: " << p->LastName;
cout << "nSocial security number: " << p->ID;
}
int ReadNumber()
{
// this function reads an integer number from the keyboard.
//it is used because input with cin >> doesn't work properly!
char buffer[20];
cin.getline(buffer, sizeof(buffer));
return atoi(buffer);
}
void DepartmentMenu (queue * q)
{
// this function defines the user interface with menu for one
int department;
int choice = 0, success; patient p;
while (choice != 6)
{
// clear screen
clrscr();
// print menu
cout <<"nWelcome to department: " << q->DepartmentName;
cout << "nPlease enter your choice:";
cout << "n1: Add normal patient";
cout << "n2: Add critically ill patient";
cout << "n3: Take out patient for operation";
cout << "n4: Remove dead patient from queue";
cout << "n5: List queue";
cout << "n6: Change department or exit";
// get user choice
choice = ReadNumber();
// do indicated action
switch (choice)
{
case 1: // Add normal patient
p = InputPatient();
if (p.ID[0])
{
success = q->AddPatientAtEnd(p);
clrscr();
if (success)
{
cout << "Patient added:";
}
else
{
// error
cout<<"Error: The queue is full. Cannot add
patient:";
}
OutputPatient(&p);
cout << "Press any key";
getch();
}
break;
case 2: // Add critically ill patient
p = InputPatient();
if (p.ID[0])
{
success = q->AddPatientAtBeginning(p);
clrscr();
if (success)
{
cout << "Patient added:";
}
else
{
// error
cout << "Error: The queue is full. Cannot add
patient:";
}
OutputPatient(&p);
cout << "Press any key";
getch();
}
break;
case 3: // Take out patient for operation
p = q->GetNextPatient();
clrscr();
if (p.ID[0])
{
cout << "Patient to operate:";
OutputPatient(&p);}
else
{
cout << "There is no patient to operate.";
}
cout << "Press any key";
getch();
break;
case 4: // Remove dead patient from queue
p = InputPatient();
if (p.ID[0])
{
success = q->RemoveDeadPatient(&p);
clrscr();
if (success)
{
cout << "Patient removed:";
}
else
{
// error
cout << "Error: Cannot find patient:";
}
OutputPatient(&p);
cout << "Press any key";
getch();
}
break;
case 5: // List queue
clrscr();
q->OutputList();
cout << "Press any key";
getch(); break;
}
}
}
// main function defining queues and main menu
void main ()
{
int i, MenuChoice = 0;
// define three queues
queue departments[3];
// set department names
strcpy (departments[0].DepartmentName, "Heart clinic");
strcpy (departments[1].DepartmentName, "Lung clinic");
strcpy (departments[2].DepartmentName, "Plastic surgery");
while (MenuChoice != 4)
{
// clear screen
clrscr();
// print menu
cout << "Welcome to Sanjeevani City Hospital";
cout << "nPlease enter your choice:";
for (i = 0; i < 3; i++)
{
// write menu item for department i
cout << "n " << (i+1) << ": " <<
departments[i].DepartmentName;
}
cout << "n 4: Exit";
// get user choice
MenuChoice = ReadNumber();
// is it a department name?
if (MenuChoice >= 1 && MenuChoice <= 3)
{
// call submenu for department
// (using pointer arithmetics here:)
DepartmentMenu (departments + (MenuChoice-1));
}
}
}
This is to certify that Abhishek Sinha of class XII-
‘Science’, Kendriya Vidyalaya Kumbhirgram,
Assam has successfully completed his project in
games and sports subject as prescribed by CBSE in
the year 2016-17.
This project is absolutely genuine and does not
indulge in plagiarism of any kind. The references
taken in making this project have been declared at
the end of this project.
Date:
Registration No.:
Signature (Examiner)
INDEX
S.NO. CONTENTS PAGE NO.
1. CERTIFICATE 3.
2. ACKNOWLEDGEMENT 4.
3. INTRODUCTION 5.
4. HISTORY 5-6.
5. SUB TYPES 6-11.
6. BIBLIOGRAPHY 15.
This program is mainly intended for the various
activities that are carried out at the Hospital. In this
project we included about how we can find out the
information about the various operations carried out
at a hospital.
The program is sub-divided into 4 departments listed
below:
Heart Clinic
Lung Clinic
Plastic Surgery
Exit
In this C++ program we can add, delete, recall and
modify the list of patients.
Being OOP concept available, we can add or remove
function anytime we need and even add classes and
derived classes for further improvement of the
program without recording.
REQUIREMENTS
HARDWARE REQUIRED:-
Printer, to print the required documents of the project.
Compact Disk
Processor: Pentium III
RAM: 2GB
Hard Disk: 120GB
SOFTWARE REQUIRED:-
Operating System: Windows 7 Ultimate
Turbo C++, for execution of Program.
M.S. Word, for presentation of output.
A Project Report On
HOSPITAL MANAGEMENT SYSTEM
(SESSION 2016-2017)
Project Prepared By:-
ABHISHEK SINHA
Class: XII – ‘A’
Under the Guidance of
Mr. C.P. Meena
PGT(COMPUTER SCIENCE)
KENDRIYA VIDYALAYA KUMBIRGRAM
BIBLIOGRAPHY
A) C++ Complete Reference-------------------- Herbert
B) Computer Science with C++----------------- Sumita Arora

More Related Content

What's hot

Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Pritam Samanta
 
HTTP and Your Angry Dog
HTTP and Your Angry DogHTTP and Your Angry Dog
HTTP and Your Angry DogRoss Tuck
 
Telephone billing system in c++
Telephone billing system in c++Telephone billing system in c++
Telephone billing system in c++vikram mahendra
 
Android File Manager Report PDF
Android File Manager Report PDFAndroid File Manager Report PDF
Android File Manager Report PDFPrajjwal Kumar
 
Web Technology Lab files with practical
Web Technology Lab  files with practicalWeb Technology Lab  files with practical
Web Technology Lab files with practicalNitesh Dubey
 
Introduction to rust: a low-level language with high-level abstractions
Introduction to rust: a low-level language with high-level abstractionsIntroduction to rust: a low-level language with high-level abstractions
Introduction to rust: a low-level language with high-level abstractionsyann_s
 
What should a hacker know about WebDav?
What should a hacker know about WebDav?What should a hacker know about WebDav?
What should a hacker know about WebDav?Mikhail Egorov
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing Swakriti Rathore
 
JVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's TricksJVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's TricksDoug Hawkins
 
Rust system programming language
Rust system programming languageRust system programming language
Rust system programming languagerobin_sy
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivityTanmoy Barman
 
MySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZEMySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZENorvald Ryeng
 
Cat database
Cat databaseCat database
Cat databasetubbeles
 
C s investigatory project on telephone directory
C s  investigatory project on telephone directoryC s  investigatory project on telephone directory
C s investigatory project on telephone directorySHUBHAM YADAV
 
Inkscape for web and UI mockups
Inkscape for web and UI mockupsInkscape for web and UI mockups
Inkscape for web and UI mockupsDonna Benjamin
 
Rust: Unlocking Systems Programming
Rust: Unlocking Systems ProgrammingRust: Unlocking Systems Programming
Rust: Unlocking Systems ProgrammingC4Media
 

What's hot (20)

Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game
 
HTTP and Your Angry Dog
HTTP and Your Angry DogHTTP and Your Angry Dog
HTTP and Your Angry Dog
 
Telephone billing system in c++
Telephone billing system in c++Telephone billing system in c++
Telephone billing system in c++
 
Android File Manager Report PDF
Android File Manager Report PDFAndroid File Manager Report PDF
Android File Manager Report PDF
 
Web Technology Lab files with practical
Web Technology Lab  files with practicalWeb Technology Lab  files with practical
Web Technology Lab files with practical
 
Kotlin Coroutines - the new async
Kotlin Coroutines - the new asyncKotlin Coroutines - the new async
Kotlin Coroutines - the new async
 
Introduction to rust: a low-level language with high-level abstractions
Introduction to rust: a low-level language with high-level abstractionsIntroduction to rust: a low-level language with high-level abstractions
Introduction to rust: a low-level language with high-level abstractions
 
What should a hacker know about WebDav?
What should a hacker know about WebDav?What should a hacker know about WebDav?
What should a hacker know about WebDav?
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
JVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's TricksJVM Mechanics: Understanding the JIT's Tricks
JVM Mechanics: Understanding the JIT's Tricks
 
Hexagonal architecture in PHP
Hexagonal architecture in PHPHexagonal architecture in PHP
Hexagonal architecture in PHP
 
Rust system programming language
Rust system programming languageRust system programming language
Rust system programming language
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
MySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZEMySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZE
 
Cat database
Cat databaseCat database
Cat database
 
C s investigatory project on telephone directory
C s  investigatory project on telephone directoryC s  investigatory project on telephone directory
C s investigatory project on telephone directory
 
C++ Inheritance
C++ InheritanceC++ Inheritance
C++ Inheritance
 
Java 8 Lambda and Streams
Java 8 Lambda and StreamsJava 8 Lambda and Streams
Java 8 Lambda and Streams
 
Inkscape for web and UI mockups
Inkscape for web and UI mockupsInkscape for web and UI mockups
Inkscape for web and UI mockups
 
Rust: Unlocking Systems Programming
Rust: Unlocking Systems ProgrammingRust: Unlocking Systems Programming
Rust: Unlocking Systems Programming
 

Similar to Computer Science class 12

Hospital management project_BY RITIKA SAHU.
Hospital management project_BY RITIKA SAHU.Hospital management project_BY RITIKA SAHU.
Hospital management project_BY RITIKA SAHU.Ritika sahu
 
programming Code in C thatloops requesting information about patie.pdf
programming Code in C thatloops requesting information about patie.pdfprogramming Code in C thatloops requesting information about patie.pdf
programming Code in C thatloops requesting information about patie.pdfARCHANASTOREKOTA
 
Hospital management system
Hospital management systemHospital management system
Hospital management systemSouravdhoni
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQLvikram mahendra
 
Below is my program, I just have some issues when I want to check ou.pdf
Below is my program, I just have some issues when I want to check ou.pdfBelow is my program, I just have some issues when I want to check ou.pdf
Below is my program, I just have some issues when I want to check ou.pdfdhavalbl38
 
Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Yeardezyneecole
 
Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Yeardezyneecole
 
#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdfannucommunication1
 
Investigatory Project for Computer Science
Investigatory Project for Computer Science Investigatory Project for Computer Science
Investigatory Project for Computer Science Sonali Sinha
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfHIMANSUKUMAR12
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12RithuJ
 
C++ ProgrammingSo I received help with a code that takes a diabet.pdf
C++ ProgrammingSo I received help with a code that takes a diabet.pdfC++ ProgrammingSo I received help with a code that takes a diabet.pdf
C++ ProgrammingSo I received help with a code that takes a diabet.pdffathimafancy
 
BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++vikram mahendra
 
Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...
Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...
Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...Manjeet Maan
 
A project report on libray mgt system
A project report on libray mgt system A project report on libray mgt system
A project report on libray mgt system ashvan710883
 
C++ project
C++ projectC++ project
C++ projectSonu S S
 
Student DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEmStudent DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEmhome
 

Similar to Computer Science class 12 (20)

Hospital management project_BY RITIKA SAHU.
Hospital management project_BY RITIKA SAHU.Hospital management project_BY RITIKA SAHU.
Hospital management project_BY RITIKA SAHU.
 
programming Code in C thatloops requesting information about patie.pdf
programming Code in C thatloops requesting information about patie.pdfprogramming Code in C thatloops requesting information about patie.pdf
programming Code in C thatloops requesting information about patie.pdf
 
Hospitalmanagement
HospitalmanagementHospitalmanagement
Hospitalmanagement
 
Hospital management system
Hospital management systemHospital management system
Hospital management system
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
 
Below is my program, I just have some issues when I want to check ou.pdf
Below is my program, I just have some issues when I want to check ou.pdfBelow is my program, I just have some issues when I want to check ou.pdf
Below is my program, I just have some issues when I want to check ou.pdf
 
Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Year
 
Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Year
 
#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf
 
Investigatory Project for Computer Science
Investigatory Project for Computer Science Investigatory Project for Computer Science
Investigatory Project for Computer Science
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdf
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12
 
C Language Lecture 19
C Language Lecture 19C Language Lecture 19
C Language Lecture 19
 
C++ ProgrammingSo I received help with a code that takes a diabet.pdf
C++ ProgrammingSo I received help with a code that takes a diabet.pdfC++ ProgrammingSo I received help with a code that takes a diabet.pdf
C++ ProgrammingSo I received help with a code that takes a diabet.pdf
 
BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++
 
Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...
Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...
Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...
 
A project report on libray mgt system
A project report on libray mgt system A project report on libray mgt system
A project report on libray mgt system
 
Computer Practical XII
Computer Practical XIIComputer Practical XII
Computer Practical XII
 
C++ project
C++ projectC++ project
C++ project
 
Student DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEmStudent DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEm
 

Recently uploaded

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Recently uploaded (20)

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

Computer Science class 12

  • 1. As usual a large number of people deserve my thanks for the help they provided me for the preparation of this project. First of all I would like to thank my teacher MR. N.G.B Singh Sir for his support during the preparation of this project. I am very thankful for his guidance. I would also like to thank my friends for the encouragement and information about the topic they provided to me during my efforts to prepare this topic. At last but not the least I would like to thank seniors for providing me their experience and being with me during my work.
  • 2. //Hospital management database - Project Program for Hospital Database Queue array. //**************HEADER FILE USED****************************** #include<iostream.h> #include<conio.h> #include<string.h> #include<stdlib.h> // define maximum number of patients in a queue #define MAXPATIENTS 100 // define structure for patient data struct patient { char FirstName[50]; char LastName[50]; char ID[20]; }; // define class for queue class queue { public: queue (void); int AddPatientAtEnd (patient p); int AddPatientAtBeginning (patient p); patient GetNextPatient (void); int RemoveDeadPatient (patient * p); void OutputList (void); char DepartmentName[50]; private: int NumberOfPatients; patient List[MAXPATIENTS]; }; // declare member functions for queue
  • 3. queue::queue () { // constructor NumberOfPatients = 0; } int queue::AddPatientAtEnd (patient p) { // adds a normal patient to the end of the queue. // returns 1 if successful, 0 if queue is full. if (NumberOfPatients >= MAXPATIENTS) { // queue is full return 0; } // put in new patient else List[NumberOfPatients] = p; NumberOfPatients++; return 1; } int queue::AddPatientAtBeginning (patient p) { // adds a critically ill patient to the beginning of the queue. // returns 1 if successful, 0 if queue is full. int i; if (NumberOfPatients >= MAXPATIENTS) { // queue is full return 0; } // move all patients one position back in queue for (i = NumberOfPatients-1; i >= 0; i--) { List[i+1] = List[i]; } // put in new patient List[0] = p; NumberOfPatients++; return 1; } patient queue::GetNextPatient (void) { // gets the patient that is first in the queue. // returns patient with no ID if queue is empty
  • 4. int i; patient p; if (NumberOfPatients == 0) { // queue is empty strcpy(p.ID,""); return p;} // get first patient p = List[0]; // move all remaining patients one position forward in queue NumberOfPatients--; for (i=0; i<NumberOfPatients; i++) { List[i] = List[i+1]; } // return patient return p; } int queue::RemoveDeadPatient (patient * p) { // removes a patient from queue. // returns 1 if successful, 0 if patient not found int i, j, found = 0; // search for patient for (i=0; i<NumberOfPatients; i++) { if (stricmp(List[i].ID, p->ID) == 0) { // patient found in queue *p = List[i]; found = 1; // move all following patients one position forward in queue NumberOfPatients--; for (j=i; j<NumberOfPatients; j++) { List[j] = List[j+1]; } } } return found; } void queue::OutputList (void) { // lists entire queue on screen int i; if (NumberOfPatients == 0) { cout << "Queue is empty"; }
  • 5. else { for (i=0; i<NumberOfPatients; i++) { cout << " " << List[i].FirstName; cout << " " << List[i].LastName; cout << " " << List[i].ID; } } } // declare functions used by main: patient InputPatient (void) { // this function asks user for patient data. patient p; cout << "Please enter data for new patient"<<"n First name: "; cin.getline(p.FirstName, sizeof(p.FirstName)); cout << "nLast name: "; cin.getline(p.LastName, sizeof(p.LastName)); cout << "nSocial security number: "; cin.getline(p.ID, sizeof(p.ID)); // check if data valid if (p.FirstName[0]==0 || p.LastName[0]==0 || p.ID[0]==0) { // rejected strcpy(p.ID,""); cout << "nError: Data not valid. Operation cancelled."; getch(); } return p; } void OutputPatient (patient * p) { // this function outputs patient data to the screen if (p == NULL || p->ID[0]==0) { cout << "nNo patient"; return; } else cout << "nPatient data:"; cout << "nFirst name: " << p->FirstName; cout << "nLast name: " << p->LastName; cout << "nSocial security number: " << p->ID; }
  • 6. int ReadNumber() { // this function reads an integer number from the keyboard. //it is used because input with cin >> doesn't work properly! char buffer[20]; cin.getline(buffer, sizeof(buffer)); return atoi(buffer); } void DepartmentMenu (queue * q) { // this function defines the user interface with menu for one int department; int choice = 0, success; patient p; while (choice != 6) { // clear screen clrscr(); // print menu cout <<"nWelcome to department: " << q->DepartmentName; cout << "nPlease enter your choice:"; cout << "n1: Add normal patient"; cout << "n2: Add critically ill patient"; cout << "n3: Take out patient for operation"; cout << "n4: Remove dead patient from queue"; cout << "n5: List queue"; cout << "n6: Change department or exit"; // get user choice choice = ReadNumber(); // do indicated action switch (choice) { case 1: // Add normal patient p = InputPatient(); if (p.ID[0]) { success = q->AddPatientAtEnd(p); clrscr(); if (success) { cout << "Patient added:"; } else { // error cout<<"Error: The queue is full. Cannot add patient:";
  • 7. } OutputPatient(&p); cout << "Press any key"; getch(); } break; case 2: // Add critically ill patient p = InputPatient(); if (p.ID[0]) { success = q->AddPatientAtBeginning(p); clrscr(); if (success) { cout << "Patient added:"; } else { // error cout << "Error: The queue is full. Cannot add patient:"; } OutputPatient(&p); cout << "Press any key"; getch(); } break; case 3: // Take out patient for operation p = q->GetNextPatient(); clrscr(); if (p.ID[0]) { cout << "Patient to operate:"; OutputPatient(&p);} else { cout << "There is no patient to operate."; } cout << "Press any key"; getch(); break; case 4: // Remove dead patient from queue p = InputPatient(); if (p.ID[0]) { success = q->RemoveDeadPatient(&p); clrscr();
  • 8. if (success) { cout << "Patient removed:"; } else { // error cout << "Error: Cannot find patient:"; } OutputPatient(&p); cout << "Press any key"; getch(); } break; case 5: // List queue clrscr(); q->OutputList(); cout << "Press any key"; getch(); break; } } } // main function defining queues and main menu void main () { int i, MenuChoice = 0; // define three queues queue departments[3]; // set department names strcpy (departments[0].DepartmentName, "Heart clinic"); strcpy (departments[1].DepartmentName, "Lung clinic"); strcpy (departments[2].DepartmentName, "Plastic surgery"); while (MenuChoice != 4) { // clear screen clrscr(); // print menu cout << "Welcome to Sanjeevani City Hospital"; cout << "nPlease enter your choice:"; for (i = 0; i < 3; i++) { // write menu item for department i cout << "n " << (i+1) << ": " << departments[i].DepartmentName; } cout << "n 4: Exit"; // get user choice
  • 9. MenuChoice = ReadNumber(); // is it a department name? if (MenuChoice >= 1 && MenuChoice <= 3) { // call submenu for department // (using pointer arithmetics here:) DepartmentMenu (departments + (MenuChoice-1)); } } }
  • 10. This is to certify that Abhishek Sinha of class XII- ‘Science’, Kendriya Vidyalaya Kumbhirgram, Assam has successfully completed his project in games and sports subject as prescribed by CBSE in the year 2016-17. This project is absolutely genuine and does not indulge in plagiarism of any kind. The references taken in making this project have been declared at the end of this project. Date: Registration No.: Signature (Examiner)
  • 11. INDEX S.NO. CONTENTS PAGE NO. 1. CERTIFICATE 3. 2. ACKNOWLEDGEMENT 4. 3. INTRODUCTION 5. 4. HISTORY 5-6. 5. SUB TYPES 6-11. 6. BIBLIOGRAPHY 15.
  • 12. This program is mainly intended for the various activities that are carried out at the Hospital. In this project we included about how we can find out the information about the various operations carried out at a hospital. The program is sub-divided into 4 departments listed below: Heart Clinic Lung Clinic Plastic Surgery Exit In this C++ program we can add, delete, recall and modify the list of patients. Being OOP concept available, we can add or remove function anytime we need and even add classes and derived classes for further improvement of the program without recording.
  • 13. REQUIREMENTS HARDWARE REQUIRED:- Printer, to print the required documents of the project. Compact Disk Processor: Pentium III RAM: 2GB Hard Disk: 120GB SOFTWARE REQUIRED:- Operating System: Windows 7 Ultimate Turbo C++, for execution of Program. M.S. Word, for presentation of output.
  • 14. A Project Report On HOSPITAL MANAGEMENT SYSTEM (SESSION 2016-2017) Project Prepared By:- ABHISHEK SINHA Class: XII – ‘A’ Under the Guidance of Mr. C.P. Meena PGT(COMPUTER SCIENCE) KENDRIYA VIDYALAYA KUMBIRGRAM
  • 15. BIBLIOGRAPHY A) C++ Complete Reference-------------------- Herbert B) Computer Science with C++----------------- Sumita Arora