Вы находитесь на странице: 1из 27

Institutional Practical Training Project Report

On
“ MEDICAL SHOP MANAGEMENT “

Submitted in the Partial fulfillment of the requirement for the Award of Degree of

Bachelor of Technology
in
COMPUTER SCIENCE & ENGINEERING

Batch
(2018-2022)

Submitted to Submitted by:


HOD(CSE) Rajat -1800289
Opinder -1800274

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Amritsar College of Engineering & Technology,


Amritsar
(Autonomous college under UGC Act – 1956[2(f) and 12(B)] )
ACKNOWLEDGEMENTS

This is a humble effort to express our sincere gratitude towards those who have guided and
helped us to complete this project.

A project is major milestone during the study period of a student. As such this project was a
challenge to us and was an opportunity to prove our caliber. We are highly grateful and obliged
to each and everyone making us help out of problems being faced by us.

It would not have been possible to see through the undertaken project without the guidance of
MRS. SAKSHI . It was purely on the basis of their experience and knowledge that we able to
clear all the theoretical and technical hurdles during the development phases of this project work.

Last but not the least We are very thankful to our Head of Department Er. Vinod Kumar Sharma
and all Members of Computer Science Deptt. who gave us an opportunity to face real time
problems while fulfilling need of an organization by making projects for them.

2
DECLARATION

We hereby declare that the project work entitled “MEDICAL SHOP MANAGEMENT” is an
authentic record of my own work carried out as requirements of Institutional Training project for
the award of degree of B.Tech(CSE), Amritsar College of Engg. And Technology, Amritsar,
under the guidance of MRS. SAKSHI

(Signature of student)

Name of Student: RAJAT,OPINDER


Univ. Roll No. : 18002889,1800274

Certified that the above statement made by the student is correct to the best of our knowledge
and belief.

Faculty Coordinator

Er. Vinod Sharma ( Associate Professor – HOD CSE Department)

Er. Shivani ( Assistant Professor – CSE Department)

Er. Parambir Singh ( Assistant Professor – CSE Department)

Er. Sarabpreet Singh ( Assistant Professor – CSE Department)

3
INDEX PAGE

Sr. Content Page No.


No.

1. Introduction about the Language Used 5-7

2. Objectives of the project 8

3. Project Code 9-22

4. Output 23-26

5. Refrences 27

4
5
Introduction to C++

The Origins of C++

C++ was developed by Bjarne Stroustrup of AT&T Bell Laboratories in the early 1980's, and is based on
the C language. The "++" is a syntactic construct used in C (to increment a variable), and C++ is intended
as an incremental improvement of C. Most of C is a subset of C++, so that most C programs can be
compiled (i.e. converted into a series of low-level instructions that the computer can execute directly)
using a C++ compiler

The Programming Environment

We need several pieces of software:

�� An editor with which to write and modify the C++ program components or source code,

�� A compiler with which to convert the source code into machine instructions which can be
executed by the computer directly,

�� A linking program with which to link the compiled program components with each other
and with a selection of routines from existing libraries of computer code, in order to form the
complete machine-executable object program,

�� A debugger to help diagnose problems, either in compiling programs in the first place, or if
the object program runs but gives unintended results

Program Execution Stages

6
The Features of C++

C++ is the multi paradigm, compile, free form , general purpose, statistically typed programming
language. This is known as middle level language as it comprises of low level and high level language
features.
And there are some other things and advantages of this language over the C. The first commercial
implementation of the C++ was released in 1985 and before that the name of language was changed to
“C++”. And some new features were added to the language and The main features of the C++ are
 Classes
 Inheritance
 Data abstraction and encapsulation
 Polymorphism
 Dynamic Binding
 Message Passing

1) Classes: By using classes we can create user defined data types. In other words the class is the
collection of set of data and code. The class allows us to do some things which are polymorphism,
inheritance, abstraction, encapsulation which are our next features. The objects are the instances of
classes.

7
The syntax for class is :
Class <class-name>
{
//Body of class;
};

2) Inheritance: Inheritance allows one data type to acquire properties of other data types. Inheritance
from a base class may be declared as public, protected, or private. If the access specifier is omitted, a
“class” inherits privately, while a “struct” inherits publicly. This provides the idea of reusability that
means we can add the new features to an existing class without modifying it.

3) Data Abstraction and Encapsulation: Encapsulation means hiding of data from the data structures
or in other words wrapping up of data in single entity is known as Encapsulation. In this the data is not
accessible to outside world and only the functions are allowed to access it. When we want to write the
class in which we don’t have the knowledge about the arguments used to instantiate it then we can use
templates in C++. Abstraction can be defined as the act of representing essential features without
including background details.

4) Polymorphism: it means that the one interface can be used for many implementation so that object
can behave differently for each implementation. The different types of polymorphism are static (Compile
time) and dynamic (Run time).

5) Dynamic Binding: It means that the linking of a procedure call to code to be executed in response
to the call. A function call associated with a polymorphic reference depends on the dynamic type that
reference. And at run-time the code matching the object under current reference will be called.

6) Message Passing: An object oriented program consists of the set of objects that communicate with
each other. objects communicate with one another by sending and receiving information much the same
way as people pass messages to one another. The concept of message passing makes it easier to direct
model or simulate their real world counterparts.

OBJECTIVES OF THE PROJECT

8
In our proposed system we maintain the Design Software in an automated form in which we made

program which can be used in medical shops to maintain the records of medicines they have, as well

as it is able to add and delete the medicines records and also search for the medicine, if it is available

in the shop or not. It is also able to generate the bill for the customers.

Proposed system will contain:

1. It can store the records of medicines which is stored by names and its batch number, max
retial price, expiry date,mnufacturing date and number of pack we have avaiable in stock.
2. We can update the medicines stock by its name , retail price , expiry date and no. of packs we
have
3. We can delete any medicine from our stock by giving its name and batch number.
4. We can generate auto bill just by putting medicine name and mrp per pack.
5. We can also check the medicine records.
6. We have sign in page on our project which only grants access to further page if one can have
its password
7. It is user friendly project means one who is using it first time can easily understand its
functions and use it.

9
Code :
#include<iostream.h>
#include<process.h>
#include<iomanip.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<fstream.h>
class med_record
{
public:
char batch_no[15];
char med_co[15];
char med[20];
float mrp;
char mfd[12];
char exd[12];

void input();
void display();
}p;

void med_record::input()
{
cout<<"Enter Medicine Company:";
gets(med_co);
cout<<"Enter Medicine Name:";
gets(med);
cout<<"Enter MRP (per pack):";
cin>>mrp;
cout<<"Enter Manufacturing Date:";
gets(mfd);
cout<<"Enter Expiry Date:";
gets(exd);
}
void med_record::display()
{
cout<<setw(7)<<batch_no<<setw(12)<<med_co<<setw(18)<<med;
cout<<setw(7)<<mrp<<setw(13)<<mfd<<setw(13)<<exd<<endl;
}

10
class stock
{
public:
char batch_no[15];
int qty;
int rqty;
int demand;

void in_d()
{
cout<<"Medicine company is "<<p.med_co;
cout<<"\nMedicine name is "<<p.med<<endl;
}
void cal_d()
{
demand=rqty-qty;
cout<<demand;
}
void inputa();
void displaya();
}q;

void stock::inputa()
{
cout<<"Enter Quantity in Stock (in packs):";
cin>>qty;
cout<<"\nEnter req Quantity of medicine:";
cin>>rqty;
}
void stock::displaya()
{

cout<<setw(7)<<q.batch_no<<setw(12)<<p.med_co<<setw(18)<<p.med<<setw(8)<<qty<<setw
(8)<<rqty<<setw(8)<<demand<<endl;
}

/*class bill
{
char c_name[15];
char c_mobile[12];
int quant;
float amt;

*/
fstream f,g,h;
char z[10],y[10],u[10];
char a,c,b[15],mfd1[12],exd1[12],d[15];
int flag,n,n1,qty1,i,j;

11
float mrp1;
void password(void);
void input1(void);
void display1(void);
void update1(void);
void delete1(void);
void search1(void);
void input2(void);
void display2(void);
void update2(void);
void search2(void);
void sort(void);
void main()
{
char choice,ch,ch1,ch2,ch3;
clrscr();
password();
getch();
clrscr();
do
{
cout<<"\n\n\t\t\tMEDICAL STORE MANAGEMENT SYSTEM\n";
cout<<"\n\n\n\tPress 1 to open Medicine details"<<endl;
cout<<"\tPress 2 to open Medicine stock"<<endl;
cout<<"\tPress 3 for bill"<<endl;
cout<<"\tPress 4 to exit"<<endl;
cout<<"\n\n\n\n\tEnter your choice:";
cin>>choice;
switch(choice)
{
case '1':
clrscr();
do
{
cout<<"\n\n\t\t\tMEDICINE DETAILS\n";
cout<<"\n\n\n\tPress 1 to add a Medicinal record"<<endl;
cout<<"\tPress 2 to display Medicinal records"<<endl;
cout<<"\tPress 3 to update a Medicinal record"<<endl;
cout<<"\tPress 4 to delete a Medicinal record"<<endl;
cout<<"\tPress 5 to search a Medicinal record"<<endl;
cout<<"\tPress 6 to sort"<<endl;
cout<<"\tPress 7 to exit"<<endl;

cout<<endl<<"\n\tEnter your choice:";


cin>>ch;
switch(ch)
{
case '1':
clrscr();

12
input1();
break;
case '2':
clrscr();
display1();
break;
case '3':
clrscr();
update1();
break;
case '4':
clrscr();
delete1();
break;
case '5':
clrscr();
search1();
break;
case '6':
clrscr();
//sort();
break;
case '7':
clrscr();
cout<<"\n\n\n\n\n\n\n\t\t\t\tTHANK YOU\n\n\n\t\t\t\tPress any key";
getch();
break;
default:
clrscr();
cout<<endl<<"\n\t\t\tPlease select a valid choice\n\n\n\t\t\tPress any key";
getch();
break;
}
clrscr();
}
while(ch!='7');
break;
case '2':
clrscr();
do
{
cout<<"\n\n\n\n\t\tMEDICINE STOCK\n";
cout<<"\n\n\n\tPress 1 to input medicine stock"<<endl;
cout<<"\tPress 2 to display medicine stock"<<endl;
cout<<"\tPress 3 to update medicine stock"<<endl;
cout<<"\tPress 4 to search a medicine stock"<<endl;
cout<<"\tPress 5 to exit"<<endl;
cout<<"\n\n\n\tEnter your choice:";
cin>>ch1;

13
switch(ch1)
{
case '1':
clrscr();
input2();
break;
case '2':
clrscr();
display2();
break;
case '3':
clrscr();
//update2();
break;
case '4':
clrscr();
//search2();
break;
case '5':
clrscr();
cout<<"\n\n\t\tPress any key to return to home page";
getch();
break;
default:
clrscr();
cout<<"\n\n\n\n\t\tPlease select a valid choice";
getch();
break;
}
clrscr();
}
while(ch1!='5');
break;
case '3':
clrscr();
do
{
cout<<"\n\n\n\n\t\tBILL\n";
cout<<"\n\n\n\tPress 1 to input bill requisites"<<endl;
cout<<"\tPress 2 to display bill"<<endl;
cout<<"\tPress 3 to search by customer's name"<<endl;
cout<<"\tPress 4 to exit"<<endl;
cout<<"\n\n\n\tEnter your choice:";
cin>>ch2;
switch(ch2)
{
case '1':
clrscr();
break;

14
case '2':
clrscr();
break;
case '3':
clrscr();
break;
case '4':
clrscr();
cout<<"\n\n\n\n\n\t\tPress any key to return to home page";
getch();
break;
default:
clrscr();
cout<<"\n\n\n\n\t\tPlease select a valid choice";
getch();
break;
}
clrscr();
}
while(ch2!='4');
break;
case '4':
clrscr();
cout<<"\n\n\n\n\n\n\n\t\t\t\tTHANK YOU\n\n\n\t\t\t\tPress any key";
getch();
break;
default:
clrscr();
cout<<"\n\n\n\n\t\t\tPlease enter a valid choice";
getch();
break;
}
clrscr();
}
while(choice!='4');
//getch();
}
/**************************************************************************
*******************USER DEFINED FUNCTIONS USED IN
main()*******************
**************************************************************************/

void password()
{
i=0;
strcpy(z,"1818");
pw: clrscr();
gotoxy(20,3);

15
cout<<"AMRITSAR COLLEGE OF ENGINEERING AND TECHNOLOGY";
gotoxy(21,7);
cout<<"SIGN IN HERE";
getch();
cout<<"\n\n\t\tEnter Username:";
gets(u);
cout<<"\n\t\tEnter Password:";
for(j=0;;j++)
{
a=getch();
y[j]=a;
cout<<"*";
if(a=='\r')
{
y[j]='\0';
break;
}
}
while(i<3)
{
if(strcmp(y,z)==0)
{
cout<<"\n\n\t\t\tAccess granted";
break;
}
else
{
cout<<"\n\n\t\t\tIncorrect password";
cout<<"\n\n\t\t\tPlease try again..";
getch();
i++;
if(i<3)
goto pw;
else
exit(0);
}
}
}
void display1()
{
f.open("cpp.dat",ios::in);
cout<<setw(7)<<"B_No"<<setw(12)<<"Med_Co"<<setw(18)<<"Med_Name";
cout<<setw(7)<<"MRP"<<setw(13)<<"Mfg Date";
cout<<setw(13)<<"Exp Date"<<endl<<endl;
while(f.read((char*)&p,sizeof(p)))
p.display();
getch();
f.close();
}

16
void input1()
{
clrscr();
f.open("cpp.dat",ios::in|ios::out|ios::ate);
cout<<"\n\nEnter Batch No:";
gets(d);
f.seekg(0);
while(f.read((char*)&p,sizeof(p)))
{
if(strcmpi(p.batch_no,d)==0)
{
cout<<"\n\n\t\t\tRecord already exists\n\n\t\t\t\t\tPress any key"<<endl;
goto label;
}
}
f.clear();
f.close();
f.open("cpp.dat",ios::in|ios::out|ios::ate);
p.input();
strcpy(p.batch_no,d);
f.write((char*)&p,sizeof(p));
cout<<"\n\n\n\t\t\t\tRecord added successfully........";
label:
getch();
f.close();
}

void update1()
{
flag=0;
f.open("cpp.dat",ios::in|ios::out|ios::ate);
f.seekg(0);
cout<<"\n\n\nEnter Batch No of the medicine whose record is to be updated:";
gets(b);
while(f.read((char*)&p,sizeof(p)))
{
if(strcmpi(p.batch_no,b)==0)
{
flag=1;
break;
}
}
f.clear();
if(flag==1)
{
cout<<"\n\n\t\t\tRecord found successfully...\n\n\n";
cout<<setw(7)<<"B_No"<<setw(12)<<"Med_Co"<<setw(18)<<"Med_Name";
cout<<setw(7)<<"MRP"<<setw(13)<<"Mfg Date";

17
cout<<setw(13)<<"Exp Date"<<endl<<endl;
p.display();
getch();
clrscr();
do
{
cout<<endl<<" Press A to update Med MRP (per pack)"<<endl;
cout<<" Press B to update Med Manufacturing date"<<endl;
cout<<" Press C to update Med Expiry date"<<endl;
cout<<" Press 0 to go back"<<endl;
cout<<endl<<"Enter your choice:";
cin>>c;
f.seekp(f.tellp()-sizeof(p));
switch(c)
{
case 'A':
cout<<"Enter new MRP:";
cin>>mrp1;
p.mrp=mrp1;
f.write((char*)&p,sizeof(p));
break;
case 'B':
cout<<"Enter new Manufacturing date:";
gets(mfd1);
strcpy(p.mfd,mfd1);
f.write((char*)&p,sizeof(p));
break;
case 'C':
cout<<"Enter new Expiry date:";
gets(exd1);
strcpy(p.exd,exd1);
f.write((char*)&p,sizeof(p));
break;
case '0':
clrscr();
cout<<"\n\n\n\n\t\t\t\tPress any key..";
getch();
break;
default:
clrscr();
cout<<endl<<"\n\n\n\n\t\t\t\tPlease enter a valid choice\n\n\n\n\t\t\t\tPress any key";
}
clrscr();
}
while(c!='0');
}
else
{
cout<<"\n\n\t\t\tRecord not found...\n\n\t\t\tPress any key";

18
getch();
}
clrscr();
f.close();
if(flag==1)
{
cout<<"\n\n\n\t\t\tRecord updated successfully...";
f.open("cpp.dat",ios::in);
cout<<"\n\n\t\t\t\tUpdated record:\n\n\n";
while(f.read((char*)&p,sizeof(p)))
{
if(strcmpi(p.batch_no,b)==0)
{
cout<<setw(7)<<"B_No"<<setw(12)<<"Med_Co"<<setw(18)<<"Med_Name";
cout<<setw(7)<<"MRP"<<setw(13)<<"Mfg Date";
cout<<setw(13)<<"Exp Date"<<endl<<endl;
p.display();
}
}
cout<<"\n\n\t\t\tPress any key";
getch();
f.close();
}
}

void delete1()
{
flag=0;
f.open("cpp.dat",ios::in|ios::ate);
n=(f.tellg()/sizeof(p));
f.seekg(0);
g.open("temp.dat",ios::out|ios::ate);
cout<<"\n\nEnter Batch no of the medicine whose record is to be deleted:";
gets(b);
while(f.read((char*)&p,sizeof(p)))
{
if(strcmpi(p.batch_no,b)!=0)
{
flag++;
g.write((char*)&p,sizeof(p));
}
}
f.clear();
f.close();
g.close();
if(n==flag)
{
cout<<"\n\n\n\n\t\t\tRecord not found";
remove("temp.dat");

19
}
else
{
cout<<"\n\n\t\t\tRecord found successfully...\n\n";
cout<<setw(7)<<"B_No"<<setw(12)<<"Med_Co"<<setw(18)<<"Med_Name";
cout<<setw(7)<<"MRP"<<setw(7)<<"Qty"<<setw(13)<<"Mfg Date";
cout<<setw(13)<<"Exp Date"<<endl<<endl;
p.display();
getch();
remove("cpp.dat");
rename("temp.dat","cpp.dat");
clrscr();
cout<<"\n\n\n\n\t\t\tRecord deleted successfully...";
}
getch();
}

void search1()
{
flag=0;
f.open("cpp.dat",ios::in);
cout<<"\n\nEnter Batch no of the medicine whose record is to be displayed:";
gets(b);
clrscr();
while(f.read((char*)&p,sizeof(p)))
{
if(strcmpi(p.batch_no,b)==0)
{
flag=1;
break;
}
}
if(flag==1)
{
cout<<"\n\n\t\t\tRecord found successfully..\n\n\t\t\t Press any key";
getch();
clrscr();
cout<<setw(7)<<"B_No"<<setw(12)<<"Med_Co"<<setw(18)<<"Med_Name";
cout<<setw(7)<<"MRP"<<setw(7)<<"Qty"<<setw(13)<<"Mfg Date";
cout<<setw(13)<<"Exp Date"<<endl<<endl;
p.display();
getch();
}
else
{
cout<<"\n\n\t\t\tRecord not found.\n\n\t\t\t Press any key";
getch();
}
f.close();

20
}

/*void sort()
{
char t[15],a[15];int i,j,n;
f.open("cpp.dat",ios::in|ios::ate);
n=(f.tellg()/sizeof(p));
cout<<f.tellg()<<endl;
f.seekg(0);
while(f.read((char*)&p,sizeof(p)))
{
strcpy(a,p.batch_no);
while()
{
f.seekg(f.tellg()+sizeof(p));
if((strcmpi(a,p.batch_no))>0)
{
strcpy(t,a);
strcpy(a,p.batch_no);
strcpy(p.batch_no,t);
}
}
}
getch();
} */
void input2()
{
flag=0;
f.open("cpp.dat",ios::in|ios::ate);
h.open("cpp1.dat",ios::out|ios::ate);
cout<<"\nEnter batch no whose stock is to be added:";
gets(b);
f.seekg(0);
while(f.read((char*)&p,sizeof(p)))
{
if(strcmpi(p.batch_no,b)==0)
{
flag=1;
break;
}

}
if(flag==1)
{
strcpy(q.batch_no,b);
q.in_d();
q.inputa();
q.cal_d();
h.write((char*)&q,sizeof(q));

21
cout<<"\n\n\n\t\t\tRecord added successfully..";
}
else
cout<<"\nMedicinal Record not found";
getch();
f.close();
h.close();
}
void display2()
{
h.open("cpp1.dat",ios::in|ios::ate);

cout<<setw(7)<<"Batch_No"<<setw(12)<<"Med_Co"<<setw(18)<<"Med_Name"<<setw(8)<<"
Qty"<<setw(10)<<"Req Qty"<<setw(8)<<"Demand"<<endl<<endl;
h.seekg(0);
while(f.read((char*)&q,sizeof(q)))
q.displaya();
h.close();
getch();
}

OUTPUT:
22
23
24
25
26
References

1. BOOKS

o C++ Programming by Anshuman Sharma


o Programming in C++ by Robert Lafore
o C++ Concepts by R S Salaria

27

Вам также может понравиться