1)Write a member function named addDrug which accepts 3 parameters name, price, and quantity of a drug, then add it to the list 2) Write a member function named getDrug which accepts an integer...


write an oop using photos below


1)Write a member function named addDrug which accepts 3 parameters name, price, and quantity of a drug, then add it to the list<br>2) Write a member function named getDrug which accepts an integer parameter that represents the index (location) of the drug<br>then returns name and quantity of this drug from the specific location. (Remember: You should check the location if it is in the list<br>range or not. Otherwise, print

Extracted text: 1)Write a member function named addDrug which accepts 3 parameters name, price, and quantity of a drug, then add it to the list 2) Write a member function named getDrug which accepts an integer parameter that represents the index (location) of the drug then returns name and quantity of this drug from the specific location. (Remember: You should check the location if it is in the list range or not. Otherwise, print "Out of range"). 3) Write a member function named printAllHigher will accept a double parameter represents a price then, prints all drugs name which prices are higher than the parameter. 4) Write a non-member function named largerPharmacy that takes 2 objects of type Pharmacy by reference and returns the Pharmacy that contains number of drugs more than the other. - The main is given to you. Constraints None S Input Format You must enter 3 drugs for the first pharmacy and 6 drugs for the second pharmacy (i.e. 9 string values for name, 9 double values for price, and 9 integer values for quantity) followed by one double value E Output Format See the sample O Sample #1 Input
Use the following UML class diagrams for Pharmacy class and Drug struct to Complete the Pharmacy class by<br>writing the implementation of the required functions outside the class interface.<br>Pharmacy<br>Drug<br>drugs [60]: Drug<br>name: string<br>length: int<br>//number of drugs<br>price: double<br>+ Pharmacy ()<br>quantity: int<br>+ isFull(): bool<br>+ isEmpyt (): bool<br>+ getNumDrugs () : int<br>+ printAllDrugs () : void<br>+ addDrug (string, double, int): void<br>+ getDrug (int,string&,int&): void<br>+ printAllHigher (double): void<br>+ -Pharmacy ()<br>

Extracted text: Use the following UML class diagrams for Pharmacy class and Drug struct to Complete the Pharmacy class by writing the implementation of the required functions outside the class interface. Pharmacy Drug drugs [60]: Drug name: string length: int //number of drugs price: double + Pharmacy () quantity: int + isFull(): bool + isEmpyt (): bool + getNumDrugs () : int + printAllDrugs () : void + addDrug (string, double, int): void + getDrug (int,string&,int&): void + printAllHigher (double): void + -Pharmacy ()
Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here