Estimated time: 50 minutes For this question you will be implementing an inheritance-based system for medical drugs. The base class is called drugs it consists of two variables: category (string)....


Hey can anyone please help me solve this question?


Estimated time: 50 minutes<br>For this question you will be implementing an inheritance-based system for medical<br>drugs. The base class is called drugs it consists of two variables: category (string).<br>date_of_manufacturing (string) and has two methods enter_drug_details () that sets<br>the drug variables (setting) and show_drug_details () that prints the variables (printing).<br>The first inheriting class is called MuseleRelaxer; its private data members are:<br>tablet_name (string), dosage (int) and price_per_dosage (int): the class has following<br>functions:<br>enter_tablet_details ()<br>show_tablet_details ()<br>caleulate_price ()<br>/Prompts for input of tablet details<br>//Prints tablet details<br>/Calculates total price for tablet per volume<br>Another class PainReliever inherits drugs class, it has variables: use_within_days (int),<br>and following functions:<br>enter_reliever_details () /Prompts for input of PainReliever details<br>show_reliever_details () /Prints PainReliever details<br>check_Expiry ()<br>checks if the PainReliever has expired based on the date_of_manufacturing and<br>use_within_days variable.<br>I/This function takes as input the current date and<br>Note: The setter function of each inheriting class should call the setting function of its<br>base class, the same for printing function. You can use the std:stoi function to convert<br>string to integer. The format of the date is dd-mm. Don't care about the year. Use the<br>main function below:<br>void main() {<br>MuscleRelaxer mr;<br>mr.enter_tablet_details():<br>mr.show_tablet_details):<br>cout <<

Extracted text: Estimated time: 50 minutes For this question you will be implementing an inheritance-based system for medical drugs. The base class is called drugs it consists of two variables: category (string). date_of_manufacturing (string) and has two methods enter_drug_details () that sets the drug variables (setting) and show_drug_details () that prints the variables (printing). The first inheriting class is called MuseleRelaxer; its private data members are: tablet_name (string), dosage (int) and price_per_dosage (int): the class has following functions: enter_tablet_details () show_tablet_details () caleulate_price () /Prompts for input of tablet details //Prints tablet details /Calculates total price for tablet per volume Another class PainReliever inherits drugs class, it has variables: use_within_days (int), and following functions: enter_reliever_details () /Prompts for input of PainReliever details show_reliever_details () /Prints PainReliever details check_Expiry () checks if the PainReliever has expired based on the date_of_manufacturing and use_within_days variable. I/This function takes as input the current date and Note: The setter function of each inheriting class should call the setting function of its base class, the same for printing function. You can use the std:stoi function to convert string to integer. The format of the date is dd-mm. Don't care about the year. Use the main function below: void main() { MuscleRelaxer mr; mr.enter_tablet_details(): mr.show_tablet_details): cout < "price="" for="" the="" muscle="">< mr.calculate_price():="" painreliever="" pr;="" pr.enter_reliever_details();="" pr.show_reliever_details():="" pr.check_expiry('15-05")?="" cout="">< endl="">< "expired"="" :="" cout="">< endl="">< "not-expired"; } "not-expired";="">
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here