Question: Need help asap by 12:30am cst c++ Using the class FoodItem defined above define a HealthyFoodItem class derived from FoodItem with the following extra data
Need help asap by 12:30am cst
c++
Using the class FoodItem defined above define a HealthyFoodItem class derived from FoodItem with the following extra data member: FatContent: a double
-Define HealthyFoodItem default constructor.
-Define HealthyFoodItem parameterized constructor.
-Define all relevant member methods (setters and getters)
2.
- Write the code corresponding to HealthyFoodItem default constructor using FoodItem default constructor and initializing the FatContent to 0.
- Write the code corresponding to HealthyFoodItem parameterized constructor re-using the parameterized constructor defined in FoodItem and initializing FatContent with provided argument.
-Write the code corresponding to all setters and getters reusing function members already defined in FoodItem.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
