Question: Step 5 : Define a struct called Medicine with components name ( of type string ) , quantity ( of type int ) , and

Step 5: Define a struct called Medicine with components name(of type string), quantity(of type int), and price (of type double).
Step 6: Define a class Pharmacy with private members numberOMediciens, *p a pointer (of type Medicine), cost (of type double), and the void function findCost(). The class has the public void member functions set(), void print(), a default parametrized constructor, and a copy constructor. The function set() reads unknown medicine names, quantities, and prices from the text file "Pharmacy.txt" using the while statement while(inFile dots).
Use the following driver and "Pharmacytu"
Implement all member functions
Enforce the principle of least privileged.
\table[[Pharmacy.txt,\table[[Sample Output],[Total cost of all medicines is 1989,50]]],[\table[[Panadol],[Daivonex],[Dermovate],[Augmentin],[Benylin],[Tylenol],[Orofar],[Adol]],\table[[24],[11],[14],[8],[31],[18],[9],[28]],1813.521.542812.5136.5]]
Step 5 : Define a struct called Medicine with

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!