0% found this document useful (0 votes)
28 views1 page

Customizetea. in The Base Class, You Are Require To Create 3 Member

TeaTime offers different types of tea and customization options. The cost of tea from the menu is based on cup size, with additional RM2 per topping. Customized tea costs are based on the number of toppings selected, which are RM2 each. The document requests modeling this information using classes. A base Tea class should set drink size and number of toppings, include a pure virtual cost calculation function, and display the total cost. Derived TeaOnMenu and CustomizeTea classes complete the cost calculations based on the scenarios. A main function tests this by prompting the user to order, creating the appropriate object, and displaying the calculated cost.

Uploaded by

Jackson Chua
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

Customizetea. in The Base Class, You Are Require To Create 3 Member

TeaTime offers different types of tea and customization options. The cost of tea from the menu is based on cup size, with additional RM2 per topping. Customized tea costs are based on the number of toppings selected, which are RM2 each. The document requests modeling this information using classes. A base Tea class should set drink size and number of toppings, include a pure virtual cost calculation function, and display the total cost. Derived TeaOnMenu and CustomizeTea classes complete the cost calculations based on the scenarios. A main function tests this by prompting the user to order, creating the appropriate object, and displaying the calculated cost.

Uploaded by

Jackson Chua
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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.

You might also like