Académique Documents
Professionnel Documents
Culture Documents
Project Report On
MEDICINE
MANAGEMENT
SYSTEM
Submitted to MD University in partial fulfillment
of the requirements
For the award of the degree of
B.E.(IV semester) in Computer Application
In
ACKNOWLEDGEMENT
Date :9-september-2009
Duration: 6 weeks
Semester: 4th
INDEX
INTRODUCTION TO LANGUAGE
EVOLUTION OF LANGUAGE
CHARACTERISTICS OF LANGUAGE
REQUIREMENT OF THE PROJECT
INTRODUCTION TO PROJECT
CODING OF THE PROJECT
TESTING OF THE PROJECT
BIBLIOGRAPHY
EVOLUTION OF LANGUAGE
We begin our journey of C++ with a little history. C, the predecessor to C++,
has become one of the most popular programming languages. Originally
designed for systems programming, C enables programmers to write efficient
code and provided close access to the machine. C compilers, found on
practically every Unix system, are now available with most operating systems.
During the 1980s and into the 1990s, an explosive growth in object-oriented
technology began with the introduction of the Smalltalk language. Object-
Oriented Programming (OOP) began to replace the more traditional structured
programming techniques. This explosion led to the development of languages
which support programming with objects. Many new object-oriented
programming languages appeared: Object-Pascal, Modula-2, Mesa, Cedar,
Neon, Objective-C, LISP with the Common List Object System (CLOS), and, of
course, C++. Although many of these languages appeared in the 1980s, many
ideas of OOP were taken from Simula-67. Yes! OOP has been around since
1967.
C++ originated with Bjarne Stroustrop. In the simplest sense, if not the most
accurate, we can consider it to be a better C. Although it is not an entirely new
language, C++ represents a significant extension of C abilities. We might then
consider C to be a subset of C++. C++ supports essentially every desirable
behavior and most of the undesirable ones of its predecessor, but provides
general language improvements as well as adding OOP capability. Note that
using C++ does not imply that your are doing OOP. C++ does not force you to
use its OOP features. You can simply create structured code that uses only C+
+'s non-OOP features.
INTRODUCTION TO C++
Templates
C++ templates enable generic programming. C++ supports both function and
class templates. Templates may be parameterized by types, compile-time
constants, and other templates. C++ templates are implemented by
instantiation at compile-time. To instantiate a template, compilers substitute
specific arguments for a template's parameters to generate a concrete function
or class instance. Templates are a powerful tool that can be used for generic
programming, template metaprogramming, and code optimization, but this
power implies a cost. Template use may increase code size, since each template
instantiation produces a copy of the template code
Objects
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.
This access specifier determines whether unrelated and derived classes can
access the inherited public and protected members of the base class. Only
public inheritance corresponds to what is usually meant by "inheritance". The
other two forms are much less frequently used. If the access specifier is
omitted, a "class" inherits privately, while a "struct" inherits publicly. Base
classes may be declared as virtual; this is called virtual inheritance. Virtual
inheritance ensures that only one instance of a base class exists in the
inheritance graph, avoiding some of the ambiguity problems of multiple
inheritance.
Polymorphism
Polymorphism enables one common interface for many implementations, and for
objects to act differently under different circumstances.
Static polymorphism
Function overloading allows programs to declare multiple functions having the same
name (but with different arguments). The functions are distinguished by the number
and/or types of their formal parameters. Thus, the same function name can refer to
different functions depending on the context in which it is used. The type returned by
the function is not used to distinguish overloaded functions.
Dynamic polymorphism
Inheritance
Variable pointers (and references) to a base class type in C++ can refer to objects of
any derived classes of that type in addition to objects exactly matching the variable
type. This allows arrays and other kinds of containers to hold pointers to objects of
differing types. Because assignment of values to variables usually occurs at run-time,
this is necessarily a run-time phenomenon.
C++ also provides a dynamic_cast operator, which allows the program to safely
attempt conversion of an object into an object of a more specific object type (as
opposed to conversion to a more general type, which is always allowed). This feature
relies on run-time type information (RTTI). Objects known to be of a certain specific
type can also be cast to that type with static_cast, a purely compile-time construct
which is faster and does not require RTTI.
Ordinarily when a function in a derived class overrides a function in a base class, the
function to call is determined by the type of the object. A given function is overridden
when there exists no difference, in the number or type of parameters, between two or
more definitions of that function. Hence, at compile time it may not be possible to
determine the type of the object and therefore the correct function to call, given only a
base class pointer; the decision is therefore put off until runtime. This is called
dynamic dispatch. Virtual member functions or methods allow the most specific
implementation of the function to be called, according to the actual run-time type of
the object. In C++, this is commonly done using virtual function tables. If the object
type is known, this may be bypassed by prepending a fully qualified class name
before the function call, but in general calls to virtual functions are resolved at run
time.
/****************************************************************************
MEDICINE MANAGEMENT
****************************************************************************/
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<dos.h>
#include<graphics.h>
#include<process.h>
med m;
fstream f1;
int med::snno()
{
fstream file;
file.open("medicine.dat",ios::in|ios::binary);
file.seekg(0,ios::beg);
int count = 0;
while(file.read((char*) this, sizeof(med)))
count=sno;
file.close();
return count;
}
// Function created for main menu
void med::menu()
{
int ch;
A:
clrscr();
int driver, mode;
detectgraph(&driver, &mode);
initgraph(&driver, &mode, "..\\bgi");
int font=7;
int direction=0;
int charsize=4;
moveto(205,60);
setcolor(10);
settextstyle(font, direction,charsize);
outtext("MAIN-MENU");
gotoxy(29,10);
cout<<"1. Medicine Addition";
gotoxy(29,12);
cout<<"2. List of Medicines";
gotoxy(29,14);
cout<<"3. Sales Wizard";
gotoxy(29,16);
cout<<"4. Edit Wizard";
gotoxy(29,18);
cout<<"5. Exit";
gotoxy(24,23);
delay(1050);
char s2[] = "Enter your choice(1-5) - ";
for(int i=0; i<26; ++i)
{
delay(30);
cout<<s2[i];
}
cin>>ch;
closegraph();
switch(ch)
{
case 1 : m.newentry();
break;
case 2 : m.listing();
break;
case 3 : m.sales();
break;
case 4 : m.edit();
break;
case 5 : m.quit();
break;
default : clrscr();
gotoxy(33,12);
textcolor(10);
cprintf("Invalid Choice...");
getch();
goto A;
}
}
// Function created for record entry of the Medicine
void med:: newentry()
{
int a=m.snno();
f1.open("medicine.dat", ios::app|ios::binary);
if(!f1)
cout<<"Cannot open the file";
else
{
A:
clrscr();
int driver, mode;
detectgraph(&driver, &mode);
initgraph(&driver, &mode, "..\\bgi ");
int font=7;
int direction=0;
int size=3;
int i;
moveto(150,20);
setcolor(15);
settextstyle(font, direction, size);
outtext(" RECORD ENTRY");
// closegraph();
gotoxy(19,8);
char a1[] = "Enter Medicine Name : ";
for(i=0; i<30; ++i)
{
delay(25);
cout<<a1[i];
}
gets(name);
if(strlen(name) == 0)
{
gotoxy(19,10);
cout<<"Enter the name correctly";
getch();
goto A;
}
gotoxy(19,9);
char a2[] = "Enter Medicine type : ";
for(i=0; i<30; ++i)
{
delay(25);
cout<<a2[i];
}
gets(medtype);
gotoxy(19,10);
char a3[] = "Enter Company Name : ";
for(i=0; i<30; ++i)
{
delay(25);
cout<<a3[i];
}
gets(comname);
gotoxy(19,11);
char a4[] = "Enter Mnf'g Date(mmm-yy) : ";
for(i=0; i<30; ++i)
{
delay(25);
cout<<a4[i];
}
gets(mdate);
gotoxy(19,12);
char a5[] = "Enter Expiry Date(mmm-yy) : ";
for(i=0; i<30; ++i)
{
delay(25);
cout<<a5[i];
}
gets(edate);
gotoxy(19,13);
char a6[] = "Enter Batch No. : ";
for(i=0; i<30; ++i)
{
delay(25);
cout<<a6[i];
}
gets(mfgno);
gotoxy(19,14);
char a7[] = "Enter Licence No. : ";
for(i=0; i<30; ++i)
{
delay(25);
cout<<a7[i];
}
gets(licno);
gotoxy(19,15);
char a8[] = "Enter Cost of Medicine : Rs. ";
for(i=0; i<34; ++i)
{
delay(25);
cout<<a8[i];
}
cin>>cost;
gotoxy(19,16);
char a9[] = "Enter Quantity of Medicine : ";
for(i=0; i<30; ++i)
{
delay(25);
cout<<a9[i];
}
cin>>qty;
sno = a+1;
f1.write((char*)&m,sizeof(m));
}
f1.close();
gotoxy(48,24);
cout<<"press any key to return.......";
getch();
m.menu();
}
void med::listing()
{
f1.open("medicine.dat",ios::in|ios::binary);
if(!f1)
{
clrscr();
gotoxy(30,15);
cout<<"File not found";
getch();
}
else
{
f1.read((char*)&m,sizeof(m));
int driver, mode;
detectgraph(&driver, &mode);
initgraph(&driver, &mode, "..\\bgi ");
int font=7;
int direction=0;
int size=3;
setcolor(15);
moveto(165,10);
settextstyle(font, direction, size);
outtext(" RECORD LISTING");
gotoxy(5,5);
cout<<"S.No. "<<" Med. Name "<<" Med. Type "<<" Cost "<<"
Quantity ";
delay(1050);
gotoxy(4,4);
char ch[] =
"úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú
úúúúú";
for(int i=0; i<74; ++i)
{
delay(5);
cout<<ch[i];
}
gotoxy(4,6);
char ch2[] =
"úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú
úúúúú";
for(i=0; i<74; ++i)
{
delay(5);
cout<<ch2[i];
}
int s = 7;
while(!f1.eof())
{
textcolor(10);
gotoxy(6,s);
cout<<sno<<endl;
gotoxy(14,s);
cout<<name<<endl;
gotoxy(38,s);
cout<<medtype<<endl;
gotoxy(55,s);
cout<<"Rs."<<cost<<endl;
gotoxy(69,s);
cout<<qty<<endl;
s = s+1;
f1.read((char*)&m,sizeof(m));
}
}
f1.close();
getch();
m.menu();
}
void med::quit()
{
clrscr();
exit(0);
}
// Function created for Selling & Purchasing of Medicines
void med::sales()
{
int ch;
clrscr();
int driver, mode;
detectgraph(&driver, &mode);
initgraph(&driver, &mode, "..\\bgi");
int font=7;
int direction=0;
int charsize=4;
moveto(155,60);
setcolor(10);
settextstyle(font, direction,charsize);
outtext(" SALES WIZARD");
gotoxy(30,9);
cout<<"1. Medicine Sale";
gotoxy(30,11);
cout<<"2. Medicine Purchase";
gotoxy(30,13);
cout<<"3. Record Listing";
gotoxy(30,15);
cout<<"4. Main Menu";
gotoxy(28,19);
delay(1000);
char c1[] = "Enter your choice(1-4) - ";
for(int i=0; i<26; ++i)
{
delay(25);
cout<<c1[i];
}
cin>>ch;
closegraph();
switch(ch)
{
case 1 : m.sale();
break;
case 2 : m.purchase();
break;
case 3 : m.listing();
break;
case 4 : m.menu();
break;
default : clrscr();
gotoxy(33,12);
cout<<"Invalid Choice...";
getch();
m.sales();
break;
}
}
void med::sale()
{
WW:
clrscr();
char nam[30];
double qu;
long double price;
int g;
int c=0;
int q;
clrscr();
fstream f1("medicine.dat", ios::in|ios::out|ios::binary);
f1.read((char*)&m,sizeof(m));
f1.seekg(0);
g = f1.tellg();
textcolor(14);
gotoxy(6,3);
cprintf("Medicine Name : ");
gets(nam);
gotoxy(21,5);
textcolor(10);
if(!f1)
{
clrscr();
gotoxy(26,15);
cout<<"File not found";
getch();
}
else
{
while(!f1.eof())
{
f1.read((char*)&m,sizeof(m));
if(strcmp(name, nam) == 0)
{
c=1;
textcolor(12);
g = f1.tellg();
gotoxy(15,8);
cprintf("1. Medicine Name : ");
cout<<name<<endl;
gotoxy(15,9);
cprintf("2. Medicine Type : ");
cout<<medtype<<endl;
gotoxy(15,10);
cprintf("3. Company Name : ");
cout<<comname<<endl;
gotoxy(15,11);
cprintf("4. Manufacturing Date : ");
cout<<mdate<<endl;
gotoxy(15,12);
cprintf("5. Expiry Date : ");
cout<<edate<<endl;
gotoxy(15,13);
cprintf("6. Batch No. : ");
cout<<mfgno<<endl;
gotoxy(15,14);
cprintf("7. Licence No. : ");
cout<<licno<<endl;
gotoxy(15,15);
cprintf("8. Medicine Cost : Rs. ");
cout<<cost<<endl;
gotoxy(15,16);
cprintf("9. Medicine Quantity : ");
cout<<qty<<endl;
break;
}
}
}
if(c==0)
{
clrscr();
gotoxy(28,12);
textcolor(5);
cprintf("NAME NOT FOUND");
textcolor(12);
gotoxy(48,24);
cprintf("Press a key to continue....");
getch();
f1.close();
m.sales();
}
gotoxy(48,18);
textcolor(7);
cprintf("Press a key to continue.......");
getch();
gotoxy(15,22);
textcolor(10);
cprintf("Enter Quantity for Sale : ");
cin>>q;
if(q > qty)
{
clrscr();
gotoxy(30,16);
textcolor(6);
cprintf("Invalid Entry");
getch();
goto WW;
}
fflush(stdin);
qu=q;
price=qu*cost;
gotoxy(15,24);
cprintf("Total Cost : Rs.");
cout<<price<<endl;
gotoxy(15,23);
textcolor(13);
cprintf("Medicine Quantity Remaining: ");
qty = qty - q;
cout<<qty;
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
getch();
m.menu();
}
void med::purchase()
{
int g;
int q;
int c=0;
clrscr();
fstream f1("medicine.dat", ios::in|ios::out|ios::binary);
f1.read((char*)&m,sizeof(m));
f1.seekg(0);
g = f1.tellg();
char s[25];
textcolor(14);
gotoxy(6,3);
cprintf("Name of Medicine : ");
gets(s);
gotoxy(21,5);
textcolor(10);
if(!f1)
{
clrscr();
gotoxy(26,15);
cout<<"File not found";
getch();
}
else
{
while(!f1.eof())
{
f1.read((char*)&m,sizeof(m));
if(strcmp(name,s) == 0)
{
c=1;
textcolor(12);
g = f1.tellg();
gotoxy(15,8);
cprintf("1. Medicine Name : ");
cout<<name<<endl;
gotoxy(15,9);
cprintf("2. Medicine Type : ");
cout<<medtype<<endl;
gotoxy(15,10);
cprintf("3. Company Name : ");
cout<<comname<<endl;
gotoxy(15,11);
cprintf("4. Manufacturing Date : ");
cout<<mdate<<endl;
gotoxy(15,12);
cprintf("5. Expiry Date : ");
cout<<edate<<endl;
gotoxy(15,13);
cprintf("6. Batch No. : ");
cout<<mfgno<<endl;
gotoxy(15,14);
cprintf("7. Licence No. : ");
cout<<licno<<endl;
gotoxy(15,15);
cprintf("8. Medicine Cost : Rs. ");
cout<<cost<<endl;
gotoxy(15,16);
cprintf("9. Medicine Quantity : ");
cout<<qty<<endl;
break;
}
}
}
if(c==0)
{
clrscr();
gotoxy(28,12);
textcolor(5);
cprintf("NAME NOT FOUND");
textcolor(12);
gotoxy(48,24);
cprintf("PRESS ANY KEY TO CONTINUE...");
getch();
f1.close();
m.sales();
}
gotoxy(48,18);
textcolor(7);
cprintf("Press a key to continue.......");
getch();
gotoxy(15,22);
textcolor(10);
cprintf("Enter Quantity to Add : ");
cin>>q;
fflush(stdin);
gotoxy(15,23);
textcolor(13);
cprintf("Medicine Quantity : ");
qty = qty + q;
cout<<qty;
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
getch();
m.menu();
}
void med::edit()
{
clrscr();
S:
int driver, mode;
int ch;
detectgraph(&driver, &mode);
initgraph(&driver, &mode, "..\\bgi");
int font=7;
int direction=0;
int size=3;
moveto(155,60);
setcolor(6);
settextstyle(font, direction, size);
outtext("RECORD EDITION MENU");
gotoxy(32,9);
cout<<"1. Search Records";
gotoxy(32,11);
cout<<"2. Update Records";
gotoxy(32,13);
cout<<"3. Delete Records";
gotoxy(32,15);
cout<<"4. Record Listing";
gotoxy(32,17);
cout<<"5. Main Menu";
gotoxy(28,20);
delay(1000);
char c2[] = "Enter your choice (1-5) - ";
for(int i=0; i<26; ++i)
{
delay(25);
cout<<c2[i];
}
cin>>ch;
closegraph();
switch(ch)
{
case 1 : m.search();
break;
case 2 : m.update();
break;
case 3 : m.del();
break;
case 4 : m.listing();
break;
case 5 : m.menu();
break;
default: clrscr();
gotoxy(33,12);
textcolor(14+128);
cprintf("Invalid Choice");
getch();
m.edit();
goto S;
}
}
void med::search()
{
int i,z;
char a[10];
clrscr();
ifstream f1;
f1.open("medicine.dat");
gotoxy(15,3);
textcolor(13);
cprintf("Enter the Name : ");
cin>>a;
gotoxy(15,5);
textcolor(11+128);
cprintf("Searching......");
while(!f1.eof())
{
f1.read((char*)&m,sizeof(m));
if(strcmp(a,name) == 0)
{
gotoxy(15,5);
delay(1050);
// textcolor(14+128);
cprintf(" ");
gotoxy(20,5);
textcolor(12);
cprintf("Found - 1");
gotoxy(25,8);
textcolor(10);
cprintf("Medicine Name : ");
cout<<name<<endl;
gotoxy(25,9);
cprintf("Medicine Type : ");
cout<<medtype<<endl;
gotoxy(25,10);
cprintf("Company Name : ");
cout<<comname<<endl;
gotoxy(25,11);
cprintf("Manufacturing Date : ");
cout<<mdate<<endl;
gotoxy(25,12);
cprintf("Expiry Date : ");
cout<<edate<<endl;
gotoxy(25,13);
cprintf("Batch No. : ");
cout<<mfgno<<endl;
gotoxy(25,14);
cprintf("Licence No. : ");
cout<<licno<<endl;
gotoxy(25,15);
cprintf("Medicine Cost : Rs. ");
cout<<cost<<endl;
gotoxy(25,16);
cprintf("Medicine Quantity : ");
cout<<qty<<endl;
gotoxy(25,19);
cprintf("Serial No. : ");
cout<<sno;
gotoxy(48,24);
textcolor(14);
cprintf("Press a key to return......");
getch();
}
}
f1.close();
m.edit();
getch();
}
void med::update()
{
int g;
int n;
clrscr();
fstream f1("medicine.dat", ios::in|ios::out|ios::binary);
f1.read((char*)&m,sizeof(m));
f1.seekg(0);
g = f1.tellg();
int s;
char na[15];
textcolor(14);
gotoxy(6,3);
cprintf("Serial No. of Medicine to update : ");
cin>>s;
gotoxy(21,5);
textcolor(10);
if(!f1)
{
clrscr();
gotoxy(26,15);
cout<<"File not found";
getch();
}
else
{
while(!f1.eof())
{
f1.read((char*)&m,sizeof(m));
if(sno == s)
{
textcolor(12);
g = f1.tellg();
gotoxy(15,8);
cprintf("1. Medicine Name : ");
cout<<name<<endl;
gotoxy(15,9);
cprintf("2. Medicine Type : ");
cout<<medtype<<endl;
gotoxy(15,10);
cprintf("3. Company Name : ");
cout<<comname<<endl;
gotoxy(15,11);
cprintf("4. Manufacturing Date : ");
cout<<mdate<<endl;
gotoxy(15,12);
cprintf("5. Expiry Date : ");
cout<<edate<<endl;
gotoxy(15,13);
cprintf("6. Batch No. : ");
cout<<mfgno<<endl;
gotoxy(15,14);
cprintf("7. Licence No. : ");
cout<<licno<<endl;
gotoxy(15,15);
cprintf("8. Medicine Cost : Rs. ");
cout<<cost<<endl;
gotoxy(15,16);
cprintf("9. Medicine Quantity : ");
cout<<qty<<endl;
break;
}
}
}
gotoxy(48,18);
textcolor(7);
cprintf("Press a key to continue.......");
getch();
gotoxy(6,19);
textcolor(10);
cprintf("Enter Field No. Wish to Modify : ");
cin>>n;
fflush(stdin);
textcolor(11);
switch(n)
{
case 1 : gotoxy(15,21);
cprintf("Medicine Name : ");
gets(name);
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
break;
case 2 : gotoxy(15,21);
cprintf("Medicine Type : ");
gets(medtype);
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
break;
case 3 : gotoxy(15,21);
cprintf("Company Name : ");
gets(comname);
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
break;
case 4 : gotoxy(15,21);
cprintf("Manufacturing Date : ");
gets(mdate);
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
break;
case 5 : gotoxy(15,21);
cprintf("Expiry Date : ");
gets(edate);
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
break;
case 6 : gotoxy(15,21);
cprintf("Batch No. : ");
gets(mfgno);
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
break;
case 7 : gotoxy(15,21);
cprintf("Licence No. : ");
gets(licno);
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
break;
case 8 : gotoxy(15,21);
cprintf("Medicine Cost : Rs. ");
cin>>cost;
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
break;
case 9 : gotoxy(15,21);
cprintf("Medicine Quantity : ");
cin>>qty;
f1.seekp(g-sizeof(m));
f1.write((char*)&m,sizeof(m));
f1.close();
f1.read((char*)&m,sizeof(m));
break;
default : clrscr();
gotoxy(15,21);
textcolor(12);
cprintf("...Invalid Choice...");
getch();
m.edit();
break;
}
gotoxy(10,24);
textcolor(10+128);
cprintf("Updating......");
gotoxy(48,24);
textcolor(12);
delay(1170);
cprintf("Updation Complete.......");
gotoxy(10,24);
cprintf(" ");
getch();
m.edit();
}
// Function created for Deletion of Medicine Record
void med::del()
{
clrscr();
int sn;
char ch1;
fstream f1;
f1.open("medicine.dat", ios::in);
fstream f2;
f2.open("temp.dat", ios::out);
f1.seekg(0, ios::beg);
if(!f1)
{
gotoxy(27,12);
textcolor(10);
cout<<"File not found";
}
else
{
gotoxy(17,5);
textcolor(13);
cprintf("Enter the Serial No. Medicine : ");
cin>>sn;
while(f1)
{
if(f1.eof())
goto AA;
f1.read((char*)&m,sizeof(m));
if(sno != sn)
{
if(f1.eof())
goto AA;
f2.write((char*)&m,sizeof(m));
}
else
{
m.medname();
continue;
}
}
AA:
gotoxy(48,24);
textcolor(13);
cout<<"Press a key to return......";
getch();
f2.close();
f1.close();
remove("medicine.dat");
rename("temp.dat", "medicine.dat");
}
m.menu();
}
// The Main working Function of the program
void main()
{
int graphdriver,graphmode;
detectgraph(&graphdriver,&graphmode);
initgraph(&graphdriver,&graphmode,"..\\bgi ");
int font=8;
int direction=0;
int charsize=4;
setbkcolor(9);
moveto(215,35);
setcolor(10);
settextstyle(1,0,4);
outtext("PROJECT ON");
moveto(140,140);
outtext("FOR FULFILLMENT OF");
moveto(160,190);
outtext("DEGREE IN B.E. IN");
moveto(60,250);
settextstyle(1,0,3);
outtext("MANAV RACHNA COLLEGE OF ENGINEERING");
moveto(60,370);
settextstyle(3,0,2);
setcolor(3);
outtext("Guided By:");
moveto(60,400);
setcolor(12);
outtext("Mr. GIRISH KUMAR");
moveto(50,70);
setcolor(14);
settextstyle(5,direction,5);
outtext("MEDICINE MANAGEMENT");
font=3;
charsize=1;
setcolor(3);
settextstyle(font,direction,charsize);
charsize = 2;
moveto(420,370);
outtext("Submitted By:");
moveto(420,400);
setcolor(12);
outtext("ANUKOOL SHAH");
getch();
closegraph();
clrscr();
m.menu();
getch();
}
TESTING OF THE PROJECT
1.INTRODUCTION SCREEN
2. MAIN SCREEN
3.ADDING THE MEDICINE DETAILS
4.RECORD LISTING
5.SALES WIZARD-MENU
6.SALES WIZARD-MEDICINE SALES
7.SALES WIZARD-MEDICINE
PURCHASE
8.EDIT WIZARD-MENU
9.EDIT WIZARD-SEARCH RECORDS
1. DEFINITIONS FROM
WHATIS.COM
2. A TEXTBOOK ON C++ BY E.
BALAUGURUAWMY