Enter The Name of The Pharmacy: Mahmoud Welcome To Mahmoud's Pharmacy Is The User A (Store - Pharmacy - Patient) ?

You might also like

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

You are required to create a very simple pharmacy system comprised of three components:

1- Storage Facility.
2- The Pharmacy itself.
3- Customers (Patients).

You should design lie the below screens and functionalities:


Enter the name of the pharmacy: Mahmoud

*** Welcome to Mahmoud’s pharmacy ***


Is the user a [store – pharmacy – patient]?

NOTE: Type “ out ” if you want to switch to another option.

Store:
• Storing different medicines (by their names).
• Unlimited Quantity.

Output:
Report with: Names of medications.
The times that a medicine had been ordered from the store.
Asking whether there is a new medicine to order from outside.

Screen 1:

WELCOME TO Mahmoud’s PHARMACY:


 - - - - - - - - - - - -
Here is a menu of what we have in the store:
Name: Quantity: Times of order:
UNLIMITED
UNLIMITED
UNLIMITED
UNLIMITED
Choose an option:
Option 1: Looking for a specific medicine if it is in the store.
Option 2: Order a new medicine from outside.
Option 3: Out.
Type the number of the option you chose: 1
What is the name of the medicine you are looking for? ***
Sorry, we don’t have ***.
Do you want to order it? (Yes\No): yes
Is there a certain amount you want to order? (Yes\No): yes
What is the quantity? 20
An order of 20 boxes of *** medicine has been ordered.

Type the number of the option you chose: 3


Is the user a [store – pharmacy – patient]?

Pharmacy:

 Names of different medicines.


 Quantity of these medicines.
 Their Prices.
 If the patient wants a specific medicine or giving him one according
to his symptoms.
Output:
o Menu of medicines which are related to the patients’ symptoms.
o Show the patient similar medicines with less serious side effects.
o If he ordered a medicine with serious side effects, ask him to send
a picture of a prescription signed by a Doctor.
o If the medicine run out from the pharmacy order from the store.
o If the medicine run out from both (the pharmacy & the store) Show
the patient similar medicines.
o Tell the patient if there is a discount.
o Ask the patient if he still wants to buy after showing him a list of
his orders or if he wants to remove any item.
o Bill includes:
(The date of the day, Name of the patient, Name of the medicine,
Quantity, Price, Discount.)

Screen 2:

Enter the date of the day:


*** Welcome to Mahmoud’s Pharmacy ***
Choose one: 1- A new order 2- A report: (1/2): 1
Choose one:1-Symptoms 2-Specific medicine (1/2):1
This is a list of symptoms:
1- 2- 3- 4-
5- 6- 7- 8-
9- 10- 11- 12-
Type the numbers of your symptoms: __________________
Here is a menu of medicines that are related to the patient’s symptoms:
Name of the med.: Quantity: Side effects: Symptoms:

Note: when you want to End this type Finish.


Which medicine will you choose:
______________
This medicine is not in the menu, do you want to look further? (Yes/No): yes
There is no medicine with this name in the pharmacy.
Do you want to search in the store? (Yes/No): yes
Found it, do you want to order it from the store? (Yes/No): yes
What is the quantity? __
Which medicine will you choose:
___****_____
There is a 20% discount on it.
Which medicine will you choose:
___Finish_____
Your Orders Are:
Name of med.: Quantity: Price: Discount: Price after discount:

Do you still want to buy or you want to remove an item? (Yes/Remove):


Yes
The Bill:
****** Mahmoud’s PHARMACY ******
Date of the day:
Patient’s name:
Name of the med.: Quantity: Discount: Price:

Total Price:
Is the user a [store – pharmacy – patient]?

Patient:

o Date of the day:


o Name of patient
o Patients’ age:
o Patients’ condition: (Pregnant – heart patient – Smoker - …
etc ) // To mention side effects related to their condition.
o Order a medicine:
o Ask about the price:
o Ask if there is a discount:
o Ask if there is a better medicine: if (x == med){
o Ask if there is an alternative medicine: if(date==date_disc)
o Confirms the purchase.
o The way they will pay (Cash or Credit card).
There is a discount

Screen 3:

Name of the patient: ####


What is the date of the day:
Now we can start:
Welcome Patient #### to Mahmoud’s pharmacy.
Name of medicine:
Quantity:
Name of medicine:
It’s Your lucky day! There is a 30% discount on it, the price for the box after discount is
%d
Quantity:
Name of medicine: ***
Oops! We don’t have this medicine.
But here are some alternatives of ***:
Name: Symptoms: Side effects: price:

Name of medicine:
How old are you: 33
Are you (Pregnant – Smoker – have heart issues..): pregnant
Warning: This medicine will affect you and your child badly, Let me give you some
alternatives with less serious side effects.
Alternative List for a pregnant woman:
Name : Side effects: Price:

Name of medicine: Finish


Are you sure you want to buy what in the list or you want to remove an item?
List of Your Orders:
Name: Price: Discount:

(sure/remove)? Sure
How do you want to buy (cash / credit card): cash
You will pay: dollar.
This is your bill:

***** WELCOME TO Mahmoud’s PHARMACY *****


Date: 00/00/2020
Patient’s name: #######
Name of the drug: Discount: Price: Quantity:

The amount you paid:


The rest of the amount:
You paid using cash.
Mahmoud’s pharmacy hope you get better soon!
Sub Task 2:

I also would like you to write a C program that performs the following:
 Creates one 2D array of size 5X2, named Temperature.
 Fill the first column with random values in the range [20, 50].
 Ask the user to fill the second column with values in the range [0, 20], if he/she
enters less than 0 or more than 20, a message must be displayed for the user to
try again.
 The program should display a menu for the user to choose among 7 options as
demonstrated in the example below.
 Note that each option from 1 till 5 will call a different function as follows:
o Find maximum: will call a function named Maximum that prints the max
values for each column and as a whole. Maximum takes the 2D array as
an input.
o Find minimum: will call a function named Minimum that prints the min
values for each column and as a whole. Minimum takes the 2D array as
an input.
o Find average: will call a function named Average that prints the average
values for each column and as a whole. Average takes the 2D array as an
input
o Search value: asks the user to input a value to search for and then call a
function named Search that returns the column index if the value is found
otherwise it returns -1 if the value is not found. Search takes 2
parameters: 2D array and the value to search for.
o Merge and Convert to 1D array: calls a function named merge that takes
2 parameters: 1D array and 2D array. This function converts the 2D array
to 1D array. And the main prints the results after merging.
Example:
I have created 2D array of size 5X2, and I fill the
first column randomly with values in the range [20,
50]:
50
24
31
49
20
Please fill the second column with values in the range
[0, 20]:
1st value: -1

No, it should be in the range [0, 20]

Value 1: 0
Value 2: 23

No, it should be in the range [0, 20]

Value 2: 20
Value 3: 16
Value 4: 16
Value 5: 0

Thank you :)

What would you like to do:


1.Find maximum
2.Find minimum
3.Find Average
4.Search value
5.Merge and Convert to 1D array
6.Exit
Your choice is: 1

Maximum of 1st column 50


Maximum of 2nd column 20
Maximum of all 50

What would you like to do:


1.Find maximum
2.Find minimum
3.Find Average
4.Search value
5.Merge and Convert to 1D array
6.Exit
Your choice is: 2

Minimum of 1st column 20


Minimum of 2nd column 0
Minimum of all 0

What would you like to do:


1.Find maximum
2.Find minimum
3.Find Average
4.Search value
5.Merge and Convert to 1D array
6.Exit
Your choice is: 3

Average of 1st column 34.8


Average of 2nd column 10.4
Average of all 22.6

What would you like to do:


1.Find maximum
2.Find minimum
3.Find Average
4.Search value
5.Merge and Convert to 1D array
6.Exit
Your choice is: 4

Give a Value to search for: 16


Found in column 2

What would you like to do:


1.Find maximum
2.Find minimum
3.Find Average
4.Search value
5.Merge and Convert to 1D array
6.Exit
Your choice is: 5
The merge and convert were done successfully:

50 24 31 49 20 0 20 16 16 0

What would you like to do:


1.Find maximum
2.Find minimum
3.Find Average
4.Search value
5.Merge and Convert to 1D array
6.Exit
Your choice is: 7

Invalid Option

What would you like to do:


7.Find maximum
8.Find minimum
9.Find Average
10. Search value
11. Merge and Convert to 1D array
12. Exit
Your choice is: 6

Goodbye :)

You might also like