Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Draw the class diagram for the following partial system of four classes Human, public class Human { Student, Class, and Instructor. In the private String

image text in transcribed

Draw the class diagram for the following partial system of four classes Human, public class Human \{ Student, Class, and Instructor. In the private String name; diagram you have to show all the generalization, association, and aggregation relations. public class Student extends Human\{ private int ID; public void setID(int d) {} The system has the following rules: public int getID() {} - It is not allowed to have a class public class Instructor extends Humanf without at least one student and an private String department; instructor. public void setDepartment(String d) public String getDepartment() {} - The class can have 20 students at \} most. public class Classi - A student has to be registered in at public prias Clast prote student] students; least one class and not more than five private Instructor instructor; public void addStudent(Student s){.. classes. public void removeStudent(int id) {} - There is at most one instructor for public void printStudents() {} each class. public void setInstructor(Instructor ins) { - The instructor can be not teaching any } public Instructor getInstructor() {} class or can teach many classes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions