Question: C + + Need hpp and cpp file! part 3 : The Subclasses of Dish You will implement the Appetizer , from the Dish class

C++ Need hpp and cpp file!
part 3: The Subclasses of Dish
You will implement the Appetizer ,
from the Dish class
Important Notes (READ THEM)
All function arguments should be references in this project, unless specified otherwise.
You should follow all aforementioned programming conventions and best practices.
DO NOT USE NAMESPACE STD ... You are responsible for any points you lose by doing
so.
If the return type of a function or the type of a parameter isn't specified, you're expected to
be able to deduce what it should be based on the private member variables of the class
and what the function is supposed to accomplish.
In this project, you are not being asked to create display functions for the subclasses.
The Appetizer Class
The Appetizer class is a subclass of Dish that represents an appetizer dish.
The Appetizer class must define the following types INSIDE the class definition:
Serving Style (enum): Describes how the appetizer is served.
Enum: ServingStyle { PLATED, FAMILY_STYLE, BUFFET }
The Appetizer class must have the following private member variables:
ServingStyle serving_style_: The serving style of the appetizer.
int spiciness_level_: An integer representing the spiciness level of the appetizer on a
scale of 1 to 10.
bool vegetarian_: A flag indicating if the appetizer is vegetarian.
The Appetizer class must have the following public member functions:
Instantiate an appetizer with the default constructor:
Set its spiciness level to 7 using the appropriate setter function.
Set its serving style to FAMILY_STYLE using the appropriate setter function.
Set the vegetarian flag to true using the appropriate setter function.
Print out the appetizer's information using the accessor functions.
Expected Output:
Dish Name: UNkNOWN
Ingredients:
Preparation Timc: 0 minutes
Price: $0.00
Cu1sine Type: OTHER
Spiciness Level: 7
Scrving Stylc: FAMILY_STYLE
Vegetarian: True
The Appetizer class must have the following public member functions:
Constructors:
Default Constructor:
??**
* Default constructor.
* Initializes all private nembers with default values.
*
Parameterized Constructor:
??**
* Paraneterized constructor.
* @param name The name of the apsetizer.
* @param ingredients The ingredients used in the appetiz
* @param preptime The preparation time in minutes.
* @param price The price of the appetizer.
* @param cuisinetype The cuisine tyge of the apsetizer.
* @param servingstyle The serving style of the appetize
* @param spicinesslevel The spiciness level of the appe
* @param vegetarian Flag indicating if the aspetizer is
*'
Accessors and Mutators:
setServingStyle:
/**
Sets the serving style of the apvetizer.
@param serving_style The new serving style.
@post Sets the private member to the vi
parameter.
*/
setServingStyle
getServingStyle:
/**
@`eturn The serving style of the appetizer (as an enun).
*/
getServingStyle
setSpicinessLevel:
/**
Sets the spiciness level of the appetizer.
@pararr spiciness_level An integer representing the sp;ciness level of
the appetizer.
@post Sets the private member to the value of the
paraneter.
*\prime
setSpicinessLevel
getSpicinessLevel:
/**
@`eturn The spiciess level of the appetizer.
*/
getSpicinessLevel
setVegetarian:
/**
Sets the vegetarian flag of the appetizer.
@parar vegetarian A boolean indicating if the appetizer is
vegetarian.
@post Sets the private member to the value of :he
paraneter.
*/
setVegetarian
isVegetarian:
/**
@eturn True if tee appetizer is vegetarian, false otherwise.
*/
isVegetarian
C + + Need hpp and cpp file! part 3 : The

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!