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

TMC2413 Tut2-Q

The document discusses implementing object-oriented programming concepts in C++. It provides 4 questions as examples: 1) Create a student class with attributes and methods; 2) Identify car attributes and services for a purchase program; 3) Create a class hierarchy for different drink types; 4) Write a program that displays the drink type based on user input using the hierarchy from question 3.

Uploaded by

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

TMC2413 Tut2-Q

The document discusses implementing object-oriented programming concepts in C++. It provides 4 questions as examples: 1) Create a student class with attributes and methods; 2) Identify car attributes and services for a purchase program; 3) Create a class hierarchy for different drink types; 4) Write a program that displays the drink type based on user input using the hierarchy from question 3.

Uploaded by

123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

TMC2413 Object Oriented Software Engineering

Tutorial 2
Object-Oriented in C++
1.

Identify attributes and method for student object? By using objectoriented programming techniques (using C++) implement student as a
class with attributes and methods identified above.

2.

If you are in market to buy a car, which attributes or services are relevant
to you? Write a simple program using C++ to show these attributes and
services.

3.

Create a class hierarchy to organize the following drink classes: alcoholic,


nonalcoholic, grape juice, mineral water, lemonade, beer, and wine (Hint:
At the top of the hierarchy are the most general classes and at the bottom
are the most specific. Classes should be related to one another in
superclass-subclass hierarchies)

4.

Based on question No. 3 above write a program using C++ which will
display type of drink when the user request (key-in) the name of the
drink. For example, if user keys in beer then the system will display This
is alcoholic drink.

Tut2_q.doc

You might also like