Design two UML class diagrams for the specifications described above using the Eclipse UML designer (Papyrus).

Specification1 (50 points)

All Vehicles have some common attributes (speed and color) and common members (turnLeft, turnRight with a parameter). You can define the parameter for the members.
Bicycle and MotorVehicle are both kinds of Vehicle and are therefore shown to inherit from Vehicle. Vehicle is the superclass of both Bicycle and MotorVehicle.
MotorVehicle has engines and license plates. Attributes (e.g., sizeOfEngine and licensePlate) have been added accordingly, along with some member that allows us to examine those attributes.
Bycycle has ringBell and numberOfWheels.
MotorVehicles is the base class of both MotorBike and Car, therefore these classes not only inherit the speed and color properties from Vehicle, but also the additional attributes and members from MotorVehicle.
Both MotorBike and Car have additional attributes and members which are specific to those kinds of class.
Specification2 (50 points)

Specification 2 demonstrates the use of relationship.
Each Course maintains a list of the students on that course and the lecturer who has been assigned to teach that course.
The Course class has members that allow the adding and removing of students from the course, assigning a teacher, getting a list of the currently assigned students, and the currently assigned teacher. (You have to add attributes and members working on the Course class)
Teachers are modelled as Lecturer classes. As a lecturer may teach more than one course there is an association between Course and Lecturer. The “taughtBy” relationship shows that a Course only has a single teacher, but that a lecturer may teach several Courses.
Each Lecturer object also maintains a list of the Courses that it teaches.
There is a similar relationship between Course and Student. A course is attended by zero or more Students, and a Student may attend multiple courses.

Sample Solution

This question has been answered.

Get Answer