Sunteți pe pagina 1din 1

TeaTime as one of the top beverage company offers different range of

tea for their customers. The total cost of any tea available from the
menu is based on the size of cup with additional of RM2.00 per topping
like jelly . In order to, revolutionize the tea brewing industry by
capturing the attention of fashionable tea lovers in a stylish and
modern way. The company also offers tea customization , where the
total cost of the customized tea will be based on the number of
topping as requested by customers , where each topping cost RM2.00
will be added on top of the size of drink.
You are required to model the information given in the above into a
base class called Tea and two derived classes called TeaonMenu and
CustomizeTea. In the base class, you are require to create 3 member
functions where one of them set the size of drinks with different range
of prices (small RM 5.0 ,medium RM 8.0 ,large RM 12.0) and number of
topping requested , a pure virtual function, where it is use to calculate
the total cost of the tea and another one to display the total cost of
the tea. Derived classes will complete the calculation of the total cost
of the tea based on the above scenario.
Create a main function to test the virtual function concepts, where user
will be prompt to order either a tea from the menu or customize their
own tea. Based on the customer order, an appropriate object will be
created to calculate and display the total cost of the tea ordered.

S-ar putea să vă placă și