You are on page 1of 1

Max Point: 15

Time Allowed: 60 Min


Department of Computer Science | School of Arts & Sciences
Obtained Marks:
Course: Software Engineering
Mid Term Exam, Spring 2020

Student Name: ID:

Question.

Draw Class Diagram for showing inheritance among different vehicles based on the following criteria.

 Vehicles have some common attributes (speed and color) and common behavior (turnLeft, turnRight)
 Bicycle and MotorVehicle are Vehicle and therefore need to be inherited from Vehicle. To put this another
way, Vehicle is the superclass of both Bicycle and MotorVehicle
 MotorVehicles have engines and license plates.
 MotorVehicles is the base class of both MotorBike and Car, therefore these classes not only inherit the
speed and colour properties from Vehicle, but also the additional attributes and behavior from
MotorVehicle
 Both MotorBike and Car have additional attributes and behavior which are specific to those kinds of object.

You might also like