A class named CafeService contains • Two data members i.e. the orderID and the price of food item(s) served by • A no-argument constructor to initialize both data fields with default values of “ord#0”, 0.0 • A parameterized constructor to initialize all data fields with user-defined values Derive a class named StaffService from the class CafeService that holds the following: • Two data members i.e. o serviceFee, o the cabinNumberto which the service has been made • A function named totalCharges that returns total cost of an order (including serviceFee + price of food item(s) served) • A parameterized constructor, which requires arguments for all of its own data fields as well as for the data fields of base class • A member function named display() to show all the details of an order including orderID, price, and totalCharges In the main() function, instantiate an object of class StaffService object and test the implementation of both classes through this object.
A class named CafeService contains
• Two data members i.e. the orderID and the price of food item(s) served by
• A no-argument constructor to initialize both data fields with default values of “ord#0”,
0.0
• A parameterized constructor to initialize all data fields with user-defined values
Derive a class named StaffService from the class CafeService that holds the following:
• Two data members i.e.
o serviceFee,
o the cabinNumberto which the service has been made
• A function named totalCharges that returns total cost of an order (including serviceFee +
price of food item(s) served)
• A parameterized constructor, which requires arguments for all of its own data fields as
well as for the data fields of base class
• A member function named display() to show all the details of an order including orderID,
price, and totalCharges
In the main() function, instantiate an object of class StaffService object and test the
implementation of both classes through this object.
Step by step
Solved in 3 steps with 1 images