Programming C Project

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 38

VIETNAM NATIONAL UNIVERSITY, HANOI

INTERNATIONAL SCHOOL
-------------------------------

PROJECT
Topic: MEDICAL STORE MANAGEMENT SYSTEM

Course:

PROGRAMMING I
CourseID: INS202001

Lecturer: Pham Hai Yen

Student Name: Tran Phuong Thao StudentID: 20070983

Student Name: Pham Quynh Anh StudentID: 20070898

Student Name: Le Chi Mai StudentID: 20070796

Student Name: Vu Thi Hoa StudentID: 20070717

Student Name: Nguyen Thanh Trung StudentID: 20070008

Hanoi, 12/2022
DISTRIBUTION

Name StudentID Part Percentage


Tran Phuong Thao 20070983 Leader 100%
Purchase Medicine Code (Case 1)
Gather the code
Report editor
Pham Quynh Anh 20070898 Flowchart 100%
Update Medicine Information
Code (Case 7)
Vu Thi Hoa 20070717 Enter Case Code 100%
Stock Medicine Code (Case 4)
Le Chi Mai 20070796 Add Medicine Code (Case 5) 100%
Delete Medicine Code (Case 6)
Nguyen Thanh 20070008 Preprocessor section 100%
Trung Define the structure
Declare variable
Enter Review Code (Case2)

Page
1
Table of Contents
ABTRACT.................................................................................................................................................3
I. Introduction........................................................................................................................................4
II. Objective of project...........................................................................................................................5
III. Scope of the system............................................................................................................................5
IV. Flowchart............................................................................................................................................6
V. Designing..........................................................................................................................................10
1. Preprocessor section........................................................................................................................10
2. Define the structure.........................................................................................................................10
3. Introduction to case in the project..................................................................................................11
4. Complain case’s detail:....................................................................................................................12
CODE.......................................................................................................................................................15
RESULT...................................................................................................................................................31
VI. Discussion.........................................................................................................................................34
VII. Conclusions.......................................................................................................................................35
REFERENCES........................................................................................................................................37

Page
2
ABTRACT

The goal of the Medical Store Management System is to automate the current manual
system with the aid of computerized tools and comprehensive computer software,
meeting their needs, in order to store their important data and information for a longer
period of time with simple access and manipulation. The necessary gear and software are
readily available and simple to use.

The above-mentioned Medical Store Management System can result in an error-free,


secure, dependable, and quick management system. Instead of focusing on record
keeping, it might help the user focus on their other tasks. As a result, it will aid
organizations in making better use of their resources. The company can keep digital
records updated without making duplicate inputs. This means that, while being able to
access the information, one does not need to be diverted by irrelevant information.

The goal is to automate the company's current manual system with the use of
computerized tools and comprehensive computer software, fulfill cusstomer”s needs, in
order to retain their important data and information for a longer length of time with
simple access and modification. The project essentially outlines how to manage for food
performance and improved customer services.

Page
3
I. Introduction
To overcome the issues that existed with the traditional manual method, the "Medical
Shop Management System" was created. The difficulties our current system has are
supported by this program in an effort to remove and, in some circumstances, decrease
them. Additionally, this system is created to meet the specific requirements of the
business to conduct operations efficiently and effectively.

The program is kept as simple as possible to eliminate data entry mistakes.


Additionally, it displays an error notice when you enter incorrect data. The user doesn't
require any special training to utilize this system. This alone demonstrates how user-
friendly it is. As previously said, the Medical Shop Management System may result in
an error-free, secure, dependable, and quick management system. Instead of focusing
on record keeping, it might help the user focus on their other tasks. As a result, it will
aid organizations in making better use of their resources. No matter how large or small
a firm is, organizing the information about medicine, customers, stocks, suppliers, and
sales is a difficulty.

The Medical Store Management System project In C is developed in C programming


language, This Medical Store Management System Code In C is specially designed for
purpose of adding Medical information records like Supplier’s, Medicine Records in
Medical Stores.

Purpose
A Medical Store Management System Project In C Language elaborates the basic
concept for storing and generating all the records stored. This Medical Store System In
C Language is easy to operate and understand by users.

We provide unique personnel management systems that are tailored to your managerial
demands because every Medical Shop Management System has various customer
wants. This is intended to aid with strategic planning and will help you make sure that
your company has the appropriate amount of knowledge and information for your
future objectives. Additionally, our systems provide remote access features that will let
you manage your workforce whenever you want, anywhere. This is great for
executives who are constantly on the road and are busy. In the end, these solutions will
enable you to manage resources more effectively.

Medical Store Management System is the system used to inventory medicines in


medical stores. This system makes it possible for the store manager to record and
manage all the activities of the medical store. It also can be used in a wide range of

Page
4
wholesale and retail stores to automate the manual record keeping process primarily
related to related to cash flow and inventory.

II. Objective of project


The major object of the Medical Shop Management System Project is to handle the
information regarding Customers, Medications, Pharmaceutical Companies, Stock
levels, and Sales. It oversees the management of all customer, supplier, sales, and
customer information. Only the administrator is assured access because the project is
entirely created at the administrative end. Building an application program is the
project's goal in order to cut down on manual management of the Customer,
Medication, Supplier, and Pharmaceutical Company. It keeps track of every aspect of
the Pharmaceutical Company, Quantity in stock, and Sales.

Functionalities provided by Medical Shop Management System are as follows:


 Provides the searching facilities based on various factors. Such as Customer,
Medicine Company, Medicine Stock, Sells
 Medical Shop Management System also manage the Supplier details online for
Medicine Stock details, Sells details, Customer.
 Tracking all the information of Medicine, Supplier, Medicine Stock ect
 Manage the information of Medicine
 Shows the information and description of the Medicine
 To increase efficiency of managing the Customer, Medicine
 It deals with monitoring the information and transactions of Medicine Stock.
 Editing, adding and updating of Records is improved which results in proper
resource management of Customer data.
 Manage the information of Medicine Stock

III. Scope of the system


The project's scope System for Managing Medical Shops could aid in gathering precise
management information. The collection will be clear, uncomplicated, and logical in a
relatively short period of time. It will assist someone in fully and vividly
understanding how the previous year was managed. Additionally, it supports all
ongoing projects using the Medical Shop Management System. The administration &
collection process will be efficient, and the cost of collection will be decreased.

Our project intends to automate business procedures, hence we have attempted to


computerize numerous Medical Shop Management System activities.
When using a computer system, the user must fill out several forms, and multiple
copies of each form may be produced quickly. In a computer system, we can just print

Page
5
the manifest instead of having to prepare one first, which saves us time. to aid the
personnel in recording the time spent on each of their individual job areas.
 To increase resources' productivity through automation in order to use them
more wisely.
 The system creates multiple information kinds that may be applied to a variety
of situations.
 It satisfies the user's needs Be simple for the user and operator to comprehend
 Be simple to use Good user interface; Expandability
 First subsystem: Responsible for keeping track of the quantity and expiration
date of the medicines in stock
 Second subsystem: Billing and customer record keeping
 Third subsystem: Keeping track of sales, suppliers, and profits and losses

IV. Flowchart
The design process begins with a data flow diagram that functionally breaks down the
requirements specification. A DFD is made up of several bubbles connected by lines.
In the system, the lines and bubbles indicate data flows and data transformation,
respectively. Hardware, software, and data structures are not covered by a DFD since
it represents data flow rather than how it is processed.

A data-flow diagram (DFD) shows how data "flows" through an information system
graphically. Additionally, the visualization of data processing may be done using
DFDs (structured design). An important modeling method for understanding and
creating information processes is the data flow diagram (DFD). By definition, DFD
refers to a visual representation of how data flow through a process. Based on the
inputs and outputs of a process, DFD depicts this information flow. It is possible to
refer to a DFD as a process model. The data flow diagram is a visual representation of
the data in a system that shows how the data is processed and transformed (DFD).

We create commands that ask the user to select numbers for the system to do instead
of choosing yes/no and other text commands. To optimize the management of the
Medical Store Management System, we have set up a system that includes seven
useful cases. It includes 7 cases: purchase, add, show, search, create, delete, and
update.

Here are general flowchart and two sample flowcharts of subroutines to give you a
rough idea of the system.

Page
6
Figure 4: Algorithm of Purchase

To understand more about subroutines, we will come to the flowchart of case 1:


purchase. At first, we enter the number; if the number equals 1, we have to print the
medicine's id; if we don't remember the id of the medicine, then enter another number
to be able to enter the medicine's name instead of the id. then the program will show
the details of the medicine and ask if you want to purchase it or not. If yes, enter the
number 1 to print the quantity to purchase. If the number of medicines you want to
purchase is less than the number of medicines available, the program will show the
price to be paid. Otherwise, the program will end.

Page
7
Next is the flowchart of the update. First, we will print the ID of the medicine. The
program will load the data and show you seven options. If we enter numbers less than 0
and greater than 7, the program will exit. If you just enter the wrong number, we can still
go back by entering number 1 to change other details, and this time the program will
show choices again. If we enter a number not equal to 1 then the program will end.

Figure 3: Algorithm of Update

Now we will go into 7 choices. After printing the id of medicine, the program will
display 7 options corresponding to the numbers from 1 to 7 for us to choose from

Page
8
depending on our changing needs. After updating the information, if you want to change
other details, continue to enter number 1. If not, enter another number to end.

Page
9
Figure 1: Medicine Store Flowchart

V. Designing
1. Preprocessor section
All program header files are located in the preprocessing area. The header files are
linked to the system libraries, instructing the system to do so. When a function is being
compiled, the #include line incorporates the particular file as a component of the
function. As a result, the function being compiled is done so along with the contents of
the included file. The definitions of stdin, stdout, and stderr are included in the
standard input output files, which are included in the #includestdio.h>. The directive
#includestdio.h> must be used whenever the definitions of stdin, stdout, and stderr are
needed in a function.

For a variety of uses, there are several header files accessible. Here we use:
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>

2. Define the structure


To start the program, need to declare the variable in the program first. “Struct”
keyword is used to define structure, here we declare structure variable at the time of
structure definition by number of variables in our work is permanent

We will use the integer format. Next is to declare variables of type character (char) and
we scope for the members of type character certain character limit, with “Name” and
“Company” are 100, “Date” variables are 11, and “info” is 5000. If this limit is
exceeded, then starting from the character that is out of the allowed limit, our system
will no longer accept it.

The next part is Introduction elements in system. Here we have not had a format for
the cases yet, so we will use "void" to write out the cases. Variable “int number” is the
format for the system to identify the request that the user chooses to do the request.
Export information of drugs already in the system

Finally we write a program that records the drugs that are currently available in the
system We wrote out 20 drug samples Start from function “main”, Return type of
function main is “int”

Page
10
This line: for(i=0;i<100;i++) meaning for every time that i is smaller than 100, I'm
going to do whatever is in the code block. Whenever i reaches 100, I'll stop. After each
iteration of the loop, it increments i by 1 (i++), so that the loop will eventually stop
when it meets the i < 100 (i becomes 100, so no longer is smaller than) condition.

Our available data only contains 99 items, the user can enter new drug information but
after the program ends, all data entered from the outside will be deleted from the
temporary memory.

Use the “strcpy” statement to copy the data of the Date, name, company, info elements
down to the samples

3. Introduction to case in the project


We write program detail for 7 cases:
 Case 1: purchase medicine
 Case 2: enter information about medicine
 Case 3: stock of medicine in store
 Case 4: know about medicine information
 Case 5: add medicine in store
 Case 6: delete medicine in store
 Case 7: change medicine details

We use the Do - While command to write above 7 statements. First, we use the
“printf” command to make the program appear to request the user to select the number
corresponding to the statement for the program to execute.

After that, the program will scan the number that the user has just entered with the
"scanf" command, if it is valid, the program will convert it to the corresponding
request with the "switch" command and start moving to the next working step. When a
case is completed, the program will end by “break” command and switch to waiting
for the user to request the next.

If While = 1 meaning If the user enters the wrong number, the program will return to
the original work, and continue that loop until the user enters the correct number.
Command fflush(stdin); use for the program deletes the information just entered and
stored in redundant memory after each case finishes working.

Page
11
Table 1: Medical Store Management User Interface Screens

Screen Name Description


Login Log into the system as a pharmacist or
Manager
Menu to control The beginning workscreen and repeats
after the end of the previous working
case
Case 1: Purchase Medicine Total the detail of purchased medicine in
a bill and total price to be paid
Case 2: Enter Info About Medicine Enter review/information of medicine
Case 3: Stock Of Medicine Check the quantity of stock
Case 4: Know Info About Medicine Search medicine in system by ID
Case 5: Add Medicine in Store Add a new medicine information
Case 6: Delete Medicine Store Delete a medicine has existed in program
Case 7: Change Medicine Details Change a detail of a medicine

4. Complain case’s detail:


Now we will introduction to case’s detail:
Case 1:
PurchaseMedicine will be identified by the number 1 by the string int
Use If command to execute statement, If the user enter 1, then request user enter ID of
the medicine or Correct Name of Medicine. If the medicine ID has not existed in the
system, then ask user write down the Correct Name of Medicine. In case the user
enters correctly, the drug information stored in the system will be exported and ask the
user if they want to purchase this medicine immediately or user could enter a random
letter to start another work. If the user chooses 1, ask user to enter quantity, the
quantity to purchase has less than quantity in stock. If not, end the case. The system
will automatically calculate the money and print result for the user. If User entered
wrong ID, original working version is returned

Case 2:
Similar to case 1, the program also requires the user to enter the drug name. Use if else
statement to check condition, if the user enters information is correct, the program
agrees to let the user enter Review (Less than 100 characters). If the drug information
provided by the user is incorrect, the program will display the result "Entered Name
Not Found" and end.

Page
12
Case 3:
This part also like case 2, the program also requires the user to enter the drug name.
Use if else statement to check condition, if the user enters information is correct, the
program will display the specific drug information the user wants to see. In case
medicine information has just added when run program, if user has not updated review
by the case 2, then Review line will automate output: “Medicine Review/Info = Not
Available”. If “else” Medicine review has been updated in the system, then output:
"Medicine Review/Info=”. We write this by “else” command and “info” factor/Review
line will auto checked by m[i].info. If the drug information provided by the user is
incorrect, the program will display the result "Entered Name Not Found" and end.

Case 4:
The program will show all drug information (Including 20 samples originally
recorded, and new drugs added since running the program). Newly added drug
information if Review has been added, the system will display the phrase "Review or
Info=" with the information line of the drug. If no review has been added, the system
will automatically output "Review or Info=Not Available". If there are no drugs in
stock, the "else" command will return "No Items or Medicines Available"

Case 5:
This section allows users to create new drug information, including basic information,
but has not yet created a Review. In this part, each information entered will only be
saved in the temporary memory, after the session is closed, the drug data here will also
be deleted. After the user has entered enough information, the screen will display the
result "Medicine with id %d Added Successfully\n".

Case 6:
This section allows the user to delete the general information of a certain drug item.
However, this command we set to delete only temporarily in the current session with
the command fflush(stdin); When starting a new session, the information of the
original 20 samples remains the same.

Case 7:
This part will be a bit more complicated, after the user enters the number 7,
corresponding to the Change Medicine Details command, the system will begin to
record the numbers from 1 to 7 in turn, each specific information the user wants to
change. change:
 1 = Quantity
 2 = Price
 3 = Name

Page
13
 4 = Company
 5 = Manufacturing Date
 6 = Expiry Date
 7 = Info/Review

When the user has finished entering an information, the system will printf asking the
user to press 1 to continue changing or random another number to exit this case. If the
user enters other numbers than above, the system will end this part of work

Table 2: Medical Store Management Update List Information (Case 7)

Select Value Description


1 Change Quantity
2 Change New Price
3 Update Name
4 Update Produce Company
5 Update Manufacturing Date
6 Update Expiry date
7 Update New Review

Page
14
CODE

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>

//Step 1: define the structure of members in Medical Store Management System


struct Medicine {
int id,price,quantity;
char medicneName[100],Company[100],Mfg_Date[11],Exp_Date[11],info[5000];
}

//introduction elements in system


m[100];
void PurchaseMedicine(int number); //Medicine you want to purchase
void EnterInfoAboutMedicine(int number); //Review or Information of medicine
void StockOfMedicine(int number); //items are available or not
void KnowInfoAboutMedicine(int number); //print medicine information you want to
research
void AddMedicineinStore(int number,struct Medicine m[]); //Create a medicine into
the system
void DeleteMedicineStore(int number); //Delete a medicine
void ChangeMedicineDetails(int number); //Chang information of a medicine in the
system

//Export information of drugs already in the system


main() {
int i,choice,number=0,c;
for(i=0;i<100;i++) {
m[i].id=0;
m[i].price=0;
m[i].quantity=0;
strcpy(m[i].Mfg_Date,"");
strcpy(m[i].Exp_Date,"");
strcpy(m[i].medicneName,"");
strcpy(m[i].Company,"");
strcpy(m[i].info,"");
}

Page
15
//Output 20 sample drugs information are available
m[0].id=1;
m[0].price=120;
m[0].quantity=30;
strcpy(m[0].Mfg_Date,"04-12-2021");
strcpy(m[0].Exp_Date,"14-04-2024");
strcpy(m[0].medicneName,"Panadol Extra");
strcpy(m[0].Company,"GlaxoSmithKline (GSK)");
strcpy(m[0].info,"Reduce pain and fever");
number++;

m[1].id=2;
m[1].price=150;
m[1].quantity=48;
strcpy(m[1].Mfg_Date,"09-07-2019");
strcpy(m[1].Exp_Date,"23-11-2023");
strcpy(m[1].medicneName,"Calcium Corbiere");
strcpy(m[1].Company,"SANOFI");
strcpy(m[1].info,"5ml for children type, help supplement calcium, support to
improve osteoporosis");
number++;

m[2].id=3;
m[2].price=80;
m[2].quantity=88;
strcpy(m[2].Mfg_Date,"03-01-2023");
strcpy(m[2].Exp_Date,"08-07-2026");
strcpy(m[2].medicneName,"Phosphalugel");
strcpy(m[2].Company,"SANOFI");
strcpy(m[2].info,"Medicine for stomach pain");
number++;

m[3].id=4;
m[3].price=2570;
m[3].quantity=300;
strcpy(m[3].Mfg_Date,"17-05-2022");
strcpy(m[3].Exp_Date,"26-03-2025");
strcpy(m[3].medicneName,"Natri Clorid 0,9% 10 ml");
strcpy(m[3].Company,"DK Pharma");

Page
16
strcpy(m[3].info,"Eye drops");
number++;

m[4].id=5;
m[4].price=3465;
m[4].quantity=60;
strcpy(m[4].Mfg_Date,"30-06-2021");
strcpy(m[4].Exp_Date,"06-03-2024");
strcpy(m[4].medicneName,"Blackmores Pregnancy Iron");
strcpy(m[4].Company,"Black Mores");
strcpy(m[4].info,"Iron supplement for pregnant women");
number++;

m[5].id=6;
m[5].price=57600;
m[5].quantity=450;
strcpy(m[5].Mfg_Date,"28-08-2022");
strcpy(m[5].Exp_Date,"03-05-2027");
strcpy(m[5].medicneName,"Bio Oil");
strcpy(m[5].Company,"Mega Lifesciences Vietnam Co., Ltd");
strcpy(m[5].info,"Oil to treat stretch marks, fade scars");
number++;

m[6].id=7;
m[6].price=5000;
m[6].quantity=100;
strcpy(m[6].Mfg_Date,"15-09-2022");
strcpy(m[6].Exp_Date,"04-11-2026");
strcpy(m[6].medicneName,"Oresol Pluz");
strcpy(m[6].Company,"Hadiphar");
strcpy(m[6].info,"Effervescent tablets for rehydration and electrolytes");
number++;

m[7].id=8;
m[7].price=60780;
m[7].quantity=200;
strcpy(m[7].Mfg_Date,"11-01-2022");
strcpy(m[7].Exp_Date,"25-10-2026");
strcpy(m[7].medicneName,"Ginkgo Biloba");
strcpy(m[7].Company,"Healthy care");

Page
17
strcpy(m[7].info,"Improve memory, activate blood and nourish the brain");
number++;

m[8].id=9;
m[8].price=6000;
m[8].quantity=100;
strcpy(m[8].Mfg_Date,"06-11-2022");
strcpy(m[8].Exp_Date,"21-12-2024");
strcpy(m[8].medicneName,"Vitamin C Enlie");
strcpy(m[8].Company,"Enlie");
strcpy(m[8].info,"Vitamin C supplement");
number++;

m[9].id=10;
m[9].price=80900;
m[9].quantity=510;
strcpy(m[9].Mfg_Date,"08-11-2022");
strcpy(m[9].Exp_Date,"31-12-2026");
strcpy(m[9].medicneName,"Milk Thistle Extract");
strcpy(m[9].Company,"Puritan’s Pride");
strcpy(m[9].info,"Cool liver, detox");
number++;

m[10].id=11;
m[10].price=7200;
m[10].quantity=120;
strcpy(m[10].Mfg_Date,"24-12-2022");
strcpy(m[10].Exp_Date,"18-02-2026");
strcpy(m[10].medicneName,"Farzincol");
strcpy(m[10].Company,"Pharmedic");
strcpy(m[10].info,"Supplement daily zinc requirements, treat zinc deficiency,
diarrhea treatment");
number++;

m[11].id=12;
m[11].price=3150;
m[11].quantity=70;
strcpy(m[11].Mfg_Date,"16-10-2022");
strcpy(m[11].Exp_Date,"09-09-2025");
strcpy(m[11].medicneName,"Cetirizine Stada");

Page
18
strcpy(m[11].Company,"Stada");
strcpy(m[11].info,"Treatment of allergic rhinitis, urticaria");
number++;

m[12].id=13;
m[12].price=1000;
m[12].quantity=50;
strcpy(m[12].Mfg_Date,"05-12-2022");
strcpy(m[12].Exp_Date,"03-12-2024");
strcpy(m[12].medicneName,"Denicol");
strcpy(m[12].Company,"Sagopha");
strcpy(m[12].info,"Treatment of thrush, mouth sores, swollen gums for children");
number++;

m[13].id=14;
m[13].price=3825;
m[13].quantity=45;
strcpy(m[13].Mfg_Date,"27-09-2022");
strcpy(m[13].Exp_Date,"03-01-2026");
strcpy(m[13].medicneName,"Biafine");
strcpy(m[13].Company,"Johnson & Johnson");
strcpy(m[13].info,"Treat burns, restore damaged skin.");
number++;

m[14].id=15;
m[14].price=17100;
m[14].quantity=90;
strcpy(m[14].Mfg_Date,"21-02-2022");
strcpy(m[14].Exp_Date,"13-05-2025");
strcpy(m[14].medicneName,"Salonsip Gel-Patch");
strcpy(m[14].Company,"Hisamitsu");
strcpy(m[14].info,"Pain relief, anti-inflammatory musculoskeletal");
number++;

m[15].id=16;
m[15].price=1000;
m[15].quantity=40;
strcpy(m[15].Mfg_Date,"02-01-2023");
strcpy(m[15].Exp_Date,"05-03-2025");
strcpy(m[15].medicneName,"Inhaler");

Page
19
strcpy(m[15].Company,"Pharmedic");
strcpy(m[15].info,"Inhaler for colds and flu, stuffy nose");
number++;

m[16].id=17;
m[16].price=12300;
m[16].quantity=100;
strcpy(m[16].Mfg_Date,"27-05-2022");
strcpy(m[16].Exp_Date,"22-04-2027");
strcpy(m[16].medicneName,"Glucophage");
strcpy(m[16].Company,"Merck Sante");
strcpy(m[16].info,"Anti-diabetic drugs");
number++;

m[17].id=18;
m[17].price=7500;
m[17].quantity=75;
strcpy(m[17].Mfg_Date,"24-12-2022");
strcpy(m[17].Exp_Date,"16-07-2025");
strcpy(m[17].medicneName,"Dogarlic");
strcpy(m[17].Company,"Domesco");
strcpy(m[17].info,"Treatment of hyperlipidemia, dyslipidemia, prevention of
atherosclerosis");
number++;

m[18].id=19;
m[18].price=7800;
m[18].quantity=65;
strcpy(m[18].Mfg_Date,"23-07-2022");
strcpy(m[18].Exp_Date,"17-02-2025");
strcpy(m[18].medicneName,"Homtamin Ginseng");
strcpy(m[18].Company,"Korea United");
strcpy(m[18].info,"Nourish the body, reduce fatigue");
number++;

m[19].id=20;
m[19].price=3000;
m[19].quantity=10;
strcpy(m[19].Mfg_Date,"21-05-2022");
strcpy(m[19].Exp_Date,"12-09-2025");

Page
20
strcpy(m[19].medicneName,"Neurobion");
strcpy(m[19].Company,"PT Merck ptk");
strcpy(m[19].info,"Neuritis, pernicious anemia");
number++;

//Step 2: Enter command


do {
printf("Enter\n1 - Purchase Medicine\n2 - Enter Information about a Medicine\n3 -
Stock of Medicine in Store\n4 - Medicine Information\n5 - Add Medicine\n6 - Delete
a Medicine\n7 - Change Quantity of Medicine\n");
scanf("%d",&choice);
switch(choice) {
case 1: {
PurchaseMedicine(number);
break;
}
case 2: {
EnterInfoAboutMedicine(number);
break;
}
case 3: {
StockOfMedicine(number);
break;
}
case 4: {
KnowInfoAboutMedicine(number);
break;
}
case 5: {
AddMedicineinStore(number,m);
++number;
break;
}
case 6: {
DeleteMedicineStore(number);
break;
}
case 7: {
ChangeMedicineDetails(number);
break;

Page
21
}
}
printf("To Continue with other Options Enter 1 Else any other number\n");
scanf("%d",&c);
}
while(c==1);
}
//if command is 1 then output this request
void PurchaseMedicine(int number) {
int id,check,i,quantity,flag=0;
char name[100];
printf("Enter 1 if you know ID else any other number to enter Name of Medicine\n");
fflush(stdin);
scanf("%d",&check);
//If the user enter 1, then request user enter ID of the medicine
//If user enter other number, request user enter the Correct Name of Medicine
if(check==1) {
printf("Enter Id to purchase Medicine\n");
fflush(stdin);
scanf("%d",&id);
for(i=0;i<number;i++) {
//If the medicine ID has not existed in the system, then output this
if(m[i].id==id) {
flag=1;
int c;
printf("These are the details of Medicine\n");
printf("Name%s\nPrice=%d\nAvailable Quantity=%d\nCompany=%s\nMfg Date=
%s\nExp Date=%s\n",

m[i].medicneName,m[i].price,m[i].quantity,m[i].Company,m[i].Mfg_Date,m[i].Exp_
Date);
if(strcmp(m[i].info,"")==0) {
printf("Medicine Review/Info = Not Available\n");
}
//If Medicine review has saved in the system, then ask the user to enter data
{
printf("Medicine Review/Info=%s\n",m[i].info);
}

Page
22
//Step 3: Ask the user if the prescription is ready for payment
printf("Do you want to purchase %s\nIf Yes Enter 1 else any other number\
n",m[i].medicneName);
fflush(stdin);
scanf("%d",&c);
if(c==1) {
//Check the purchase and the avaiable quantity if valid for payment
printf("Enter Quantity to Purchase\n");
scanf("%d",&quantity);
if(m[i].quantity>quantity)
//If both of the above conditions are valid, the price calculated
{
printf("Total Price to be paid=%d\n",quantity*m[i].price);
}
//If not then request user enter avaiable quantity
else{
printf("Please Enter quantity below Available Quantity\n");
}
}
break;
}
}

//User entered wrong ID, original working version is returned


if(flag==0) {
printf("Entered Id Not Found\n");
}
}
//If user enter correct medicine name that information has existed in system, then
output its iformation
else {
printf("Enter Name to search and Purchase\n");
fflush(stdin);
gets(name);
for(i=0;i<number;i++) {
if(strcmp(m[i].medicneName,name)==0) {
flag=1;
int c;
printf("These are the details of Medicine\n");

Page
23
printf("Name=%s\nPrice=%d\nAvailable Quantity=%d\nCompany=%s\nMfg
Date=%s\nExp Date=%s\n",

m[i].medicneName,m[i].price,m[i].quantity,m[i].Company,m[i].Mfg_Date,m[i].Exp_
Date);
if(strcmp(m[i].info,"")==0) {
printf("Medicine Review/Info=Not Available\n");
}
else {
printf("Medicine Review/Info=%s\n",m[i].info);
}
//Ask user again if they want to confirm order
printf("Do you want to purchase %s \nIf Yes Enter 1 else any other number\
n",m[i].medicneName);
fflush(stdin);
scanf("%d",&c);
if(c==1) {
printf("Enter Quantity to Purchase\n");
scanf("%d",&quantity);
if(m[i].quantity>quantity) {
printf("Total Price to be paid=%d\n",quantity*m[i].price);
}
else{
printf("Please Enter quantity below Available Quantity\n");
}
}
break;
}
}
//Request user enter medicine name one time, if user continues to enter wrong, output
request like above line #136
if(flag==0)
{
printf("Entered Name Not Found\n");
}
}
}

//if command is 2 then output this request


void EnterInfoAboutMedicine(int number) {

Page
24
int i,flag=0,c;
char name[100],info[100];
printf("Enter Name of the medicine you want to Review or include Info\n");
fflush(stdin);
gets(name);
for(i=0;i<number;i++) {
if(strcmp(m[i].medicneName,name)==0) {
flag=1;
printf("These are the details of Medicine\n");
printf("Name=%s\nPrice=%d\nAvailable Quantity=%d\nCompany=%s\nMfg Date=
%s\nExp Date=%s\n",

m[i].medicneName,m[i].price,m[i].quantity,m[i].Company,m[i].Mfg_Date,m[i].Exp_
Date);
if(strcmp(m[i].info,"")!=0) {
//If the medicine have already avaiable
//If user doesn't want to add a review, enter other any number
printf("Review Already Available!\nIf you want to Add a Review Enter 1 else
Any other number\n");
fflush(stdin);
scanf("%d",&c);
}
//the user want to add a review by enter 1 then output
else {
printf("Enter review(less than 100 Characters)\n");
fflush(stdin);
gets(m[i].info);
}
if(c==1) {
printf("Enter review(less than 100 Characters)\n");
fflush(stdin);
gets(info);
strcat(m[i].info,"; ");
strcat(m[i].info,info);
}
}
}
if(flag==0) {
printf("Entered Name Not Found\n");

Page
25
}
}
//if command is 3 then output this request
void KnowInfoAboutMedicine(int number){
int i,flag=0;
char name[100];
printf("Enter Name of the medicine you want to see Review and Info\n");
fflush(stdin);
gets(name);
for(i=0;i<number;i++) {
if(strcmp(m[i].medicneName,name)==0) {
flag=1;
printf("These are the details of Medicine\n");
printf("Name=%s\nPrice=%d\nAvailable Quantity=%d\nCompany=%s\nMfg Date=
%s\nExp Date=%s\n",

m[i].medicneName,m[i].price,m[i].quantity,m[i].Company,m[i].Mfg_Date,m[i].Exp_
Date);
if(strcmp(m[i].info,"")!=0) {
printf("Review or Info=%s\n",m[i].info);
}
else {
printf("Review or Info=Not Available\n");
}
}
}
if(flag==0) {
printf("Entered Name Not Found\n");
}
}
//if command is 4 then output this request
void StockOfMedicine(int number) {
int i;
if(number!=0) {
printf("All Available Items are\n");
for(i=0;i<number;i++) {
if(m[i].id!=0) {
printf("Id=%d\nName=%s\t\tPrice=%d\tAvailable Quantity=%d\nCompany=%s\t\
tMfg Date=%s\tExp Date=%s\n",

Page
26
m[i].id,m[i].medicneName,m[i].price,m[i].quantity,m[i].Company,m[i].Mfg_Date,m[i]
.Exp_Date);
if(strcmp(m[i].info,"")!=0) {
printf("Review or Info=%s\n",m[i].info);
}
else {
printf("Review or Info=Not Available\n");
}
}
}
}
else {
printf("No Items or Medicines Available\n");
}
}
//if command is 5 then output this request
void AddMedicineinStore(int number,struct Medicine m[]) {
char name[100];
printf("Enter Medicine Id\n");
scanf("%d",&(m[number].id));
fflush(stdin);
printf("Enter Medicine Name\n");
fflush(stdin);
gets(name);
strcpy(m[number].medicneName,name);
printf("Enter Company Name\n");
fflush(stdin);
gets(m[number].Company);
printf("Enter Manufactured Date\n");
fflush(stdin);
gets(m[number].Mfg_Date);
printf("Enter Expiry Date\n");
fflush(stdin);
gets(m[number].Exp_Date);
printf("Enter Quantity\n");
fflush(stdin);
scanf("%d",&(m[number].quantity));
printf("Enter Price\n");

Page
27
fflush(stdin);
scanf("%d",&(m[number].price));
strcpy(m[number].info,"");
printf("Medicine with id %d Added Successfully\n",m[number].id);
}
//if command is 6 then output this request
void DeleteMedicineStore(int number) {
int id,i,flag=0,num;
printf("Enter Id to be deleted\n");
fflush(stdin);
scanf("%d",&id);
for(i=0;i<number;i++) {
if(m[i].id==id) {
flag=1;
m[i].id=0;
m[i].price=0;
m[i].quantity=0;
strcpy(m[i].medicneName,"");
strcpy(m[i].Company,"");
strcpy(m[i].Mfg_Date,"");
strcpy(m[i].Exp_Date,"");
strcpy(m[i].info,"");
num=i;
break;
}
}
if(flag==1) {
printf("Medicine with %d is Deleted Successfully\n",id);
}
}
//if command is 7 then output this request
void ChangeMedicineDetails(int number) {
int id,quantity,choice,c,i;
printf("Enter id to change Details\n");
scanf("%d",&id);
for(i=0;i<number;i++) {
if(m[i].id==id && m[i].id!=0) {
do {

Page
28
printf("Enter\n1 - Change Quantity\n2 - Change Price\n3 - Change Name\n4 -
Change Company\n5 - Change Manufaturing Date\n6 - Change Expiry Date\n7 -
Change Info\nAny other number to exit");
scanf("%d",&choice);
if(choice==1) {
int quantity;
printf("Enter Quantity to be changed\n");
fflush(stdin);
scanf("%d",&quantity);
m[i].quantity=quantity;
printf("Quantity changed Successfully\n");
}
if(choice==2) {
int price;
printf("Enter Price to be changed\n");
fflush(stdin);
scanf("%d",&price);
m[i].price=price;
printf("Price changed Successfully\n");
}
if(choice==3) {
char name[100];
printf("Enter Name to be changed\n");
fflush(stdin);
gets(name);
strcpy(m[i].medicneName,name);
printf("Medicine Name changed Successfully\n");
}
if(choice==4) {
char company[100];
printf("Enter company to be changed\n");
fflush(stdin);
gets(company);
strcpy(m[i].Company,company);
printf("Company changed Successfully\n");
}
if(choice==5) {
char mfg[11];
printf("Enter Manufacturing date to be changed\n");
fflush(stdin);

Page
29
gets(mfg);
strcpy(m[i].Mfg_Date,mfg);
printf("Manufacturing Date changed Successfully\n");
}
if(choice==6) {
char exp[11];
printf("Enter Expiry date to be changed\n");
fflush(stdin);
gets(exp);
strcpy(m[i].Exp_Date,exp);
printf("Expiry Date changed Successfully\n");
}
if(choice==7) {
char info[100];
printf("Enter Info to be changed(Less than 100 Characters)\n");
fflush(stdin);
gets(info);
strcpy(m[i].info,info);
printf("Info changed Successfully\n");
}
if(choice<=0 && choice>7) {
printf("Enter valid Choice\n");
}
printf("Enter 1 to Change other Details Else any other number\n");
fflush(stdin);
scanf("%d",&c);
}
while(c==1);
break;
}
}
}

Page
30
RESULT

Page
31
Page
32
Page
33
VI. Discussion
The limitations of the Medical Shop Management System
Even though I've done my best to make the program adaptable and simple to use, there
may still be restrictions. Although the program offers a wide variety of options to its
customers, certain complex options could not be included in it for logistical and/or
technological reasons. Due to time constraints and other key factors, it was not
possible to create software that was both dynamic and error-free. Lack of time also
forced me to overlook other things, like saving previous candidate results, etc.

Although much effort has been taken to make the program simple to use even for those
unrelated to the computer industry, it is acknowledged that a layperson may initially
find it a little challenging. To make using the program easier for the user, assistance is
offered at every stage. Limitations listed in the Medical Shop Management System
include:
 Due to some criticality, Excel export has not been provided for Customers,
Medicine.
 Since the transactions are carried out offline, there is no online information
about Medicine Company or Medicine. It is not feasible to capture or modify
stock.
 Due to hatch mode execution, Customer, Sells, and Medicine Company offline
reports cannot be created.

Page
34
 If the user enters incorrectly, the system will exit, all the items entered above
(except for the information of drugs already entered in the system - assuming
there are 20 drugs in stock) will not be saved. Again, the user is required to re-
enter from the beginning.
 After each time the program runs, the system deletes new information that the
user enters from the outside of the system. So after purchase, the quantity
information of the drug already in the system cannot be automatically deducted.
 All information the user searches for must be exactly character-by-character
(both uppercase and lowercase), otherwise the program will not be able to
recognize it.

Project's future scope: In a word, the project's future scope is around preserving data
pertaining to: We can add printer in the future.
 We can provide Medical Shop Management System with more advanced
software and more functions.
 In order to make the platform available to everyone, we will host it on web
servers.
 Establish a master-slave database structure to lessen the burden of database
queries;
 Integrate numerous load balancers to disperse the system's workload;
 Set up the backup system such that code and databases are regularly backed up
on several servers.

The improvements that can be made to this project to broaden its usefulness and scope
are those that have already been highlighted. We can keep track of both customer and
medication records here. Additionally, as can be shown from the fact that gamers
nowadays are adaptable, there is opportunity to provide a way to sustain the Medical
Shop Management System. All of the Customer, Medicine, Medicine Company,
Medicine Stock, and Medicine Sells may be maintained with improvements.

VII. Conclusions
Our initiative is only a modest effort to meet their requirement for project
management. Many user-friendly coding styles have also been adopted. This bundle
will prove to be effective in meeting all of the school's criteria. The goal of software
planning is to give the manager a framework for making credible predictions within a
constrained time period at the start of the software project. This framework should be
updated often as the project moves forward. At the conclusion, it is determined that the
following efforts have been undertaken.

Page
35
 An explanation of the project's history, setting, and relationship to earlier work
in the region.
 Developed a statement of the project's goals and objectives.
 The explanation of the objectives, domain, and applicability.
 We specify the issue that our initiative is trying to solve.
 We outline the prerequisite. System details and actions that may be taken in
relation to them.
 We create a model of the system that represents the operations that may be
carried out on the system after thoroughly understanding the problem area.
 We thoroughly described all features and functions, including screen layouts.
 We created the system's user interface and addressed security concerns.
 The system is finally put into use and put through test scenarios.

Page
36
REFERENCES

Structure of a C program - javatpoint. www.javatpoint.com. (n.d.). Retrieved January 10, 2023,


from https://www.javatpoint.com/structure-of-a-c-program

Aashi Jain. (2020). Final Project Report MEDICAL STORE MANGEMENT SYSTEM (Bachelor
Thesis, School of Computing Sciene and Engineering, India).

Suarez, A. J. (2022, October 8). Medical Store Management System in C with source code.
Itsourcecode.com. Retrieved January 10, 2023, from https://itsourcecode.com/free-
projects/c-projects/medical-store-management-system-in-c-with-source-code/
#google_vignette

PHP and MySQL Project Report on Medical Shop Management System Download. FreeProjectz.
(n.d.). Retrieved January 10, 2023, from https://www.freeprojectz.com/project-report/1780

Ros, F. (2022, February 28). Medical Store Management System in C programming with source
code. Source Code & Projects. Retrieved January 10, 2023, from https://code-
projects.org/medical-store-management-system-c-programming-source-code/

Program 263: Medical Store Project in C. (n.d.). Retrieved January 10, 2023, from
https://www.cprograms4future.com/p/medical-store.html

Amit Rajan. (n.d.). Medical Store Management System. Scribd. Retrieved January 10, 2023, from
https://fr.scribd.com/doc/69943266/Medical-Store-Management-System

Technologies, M. B. (2017, October 27). Online pharmacy store managment system project
report. Academia.edu. Retrieved January 10, 2023, from
https://www.academia.edu/34972089/ONLINE_PHARMACY_STORE_MANAGMENT_
SYSTEM_PROJECT_REPORT

Page
37

You might also like