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 : 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, FAMILYSTYLE, BUFFET
The Appetizer class must have the following private member variables:
ServingStyle servingstyle: The serving style of the appetizer.
int spicinesslevel: An integer representing the spiciness level of the appetizer on a
scale of to
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 using the appropriate setter function.
Set its serving style to FAMILYSTYLE 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: minutes
Price: $
Cusine Type: OTHER
Spiciness Level:
Scrving Stylc: FAMILYSTYLE
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 the apsetizer.
@param ingredients The ingredients used the appetiz
@param ime The preparation time minutes.
@param price The price the appetizer.
@param ype The cuisine tyge the apsetizer.
@param tyle The serving style the appetize
@param evel The spiciness level the appe
@param vegetarian Flag indicating the aspetizer
Accessors and Mutators:
setServingStyle:
Sets the serving style of the apvetizer.
@param servingstyle 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 spicinesslevel 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
