

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Exact solution of assignment no.1
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Question No.1: Create a UML class diagram that models different types of vehicles. Use inheritance to represent the relationships between the vehicle class and its subclasses (such as car, truck, and motorcycle). Solution : Main Class In the above class diagram, the vehicle class is the base class representing common attributes and behaviors of vehicles. The truck, vehicle and bike classes are subclasses that acquire from the
vehicle class, addressing explicit sorts of vehicles. Every subclass adds its own one of a kind way of behaving and credits. Question No.2: Create a UML class diagram that models a computer system. Use composition to represent the relationships between the system and its software components (such as the operating system and applications). Solution: In the above class diagram, the OS class represents the operating system component of computer system. It has two attributes name and vision along with method to getName and getVersion and boot the OS. The ComputerSystem class represents a computer system. It has composition relationship with OS class and App class.