Question: 4. Using the diagram as a reference, implement the following classes: Drug Painkiller Antibiotic The Drug class should have the following attributes: Attribute Type name
4. Using the diagram as a reference, implement the following classes: Drug Painkiller Antibiotic The Drug class should have the following attributes: Attribute Type name manufacturing_date expiration_date company name category dosage (mg) side effect String String String String String Integer String The class should also include the appropriate constructor and string methods to initialize and print the contents of each Drug instance, as well as accessor and mutator methods for each attribute. Add an attribute called contra_indications to the Painkiller class that inherits from Drug. This field is of type String, and holds the drugs that may conflict with the painkiller instance. As for the Antibiotic class, add an attribute called dosage_time of type int. You should override the __init_and_str_methods and add the appropriate accessors and mutators in Painkiller and Antibiotic classes in order to account for the new attributes. Create a test class to test all the above classes. Print all content of the variables using the str_methods. the the effects, Westen for Ir. It was then it was the 2018. The state of in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
