Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE IN JAVA UML diagram: > Comparable 1 > Gym Member getName() getMemberNumbero setMemberNumber FitnessCentre name members displayMembers C. has members > Person A. name

CODE IN JAVA

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

UML diagram: > Comparable 1 > Gym Member getName() getMemberNumbero setMemberNumber FitnessCentre name members displayMembers C. has members > Person A. name getName() toStringo > Student Instructor B. studentNum facultyID rank 1 teaches * Course taught by course Number courseName enrolls in has displayClassListo Graduate Undergraduate major supervisor PART B: Associations Continue building the Java program from Part A to add the course class. 1. Implement the associations in the following manner: a. Add the necessary class fields in classes Course, Instructor and Student. Be mindful of the type of association (1...*, *...*, etc.) when creating these fields. b. Implement an addCourse () method in the Student class that adds a course to the students list of courses. When a student adds a course, the course's class list is also updated by adding that student in it. c. Implement an assignInstructor() method to the course class that assigns an instructor to the course. When an instructor is assigned to a course, the course is also added to their teaching list. 2. In the driver class a. Instantiates 2 courses: Course Number ACS-2947 ACS-3916 Course Name Data Structures and Incantations Wizard-Computer Interaction b. Add instructors to the courses: use the assignInstructor () method of the Course class: Course ACS-2947 ACS-3916 Instructor Name Severus Snape Minerva McGonigal C. Use the addCourse () method from the Student class to add the courses to each student as per the following table: Course ACS-2947 ACS-2947 ACS-2947 ACS-3916 Student Name Harry Potter Draco Malfoy Marcus Flynt Draco Malfoy StudentNum 777 301 111 301 128 ACS-3916 ACS-3916 Percy Weasley Harry Potter 777 d. Implement the displayClassList() method in the course class that prints the list of students in the following manner: ACS-2947 Data Structures and Incantations Instructor: Severus Snape Student# Name status 777 Harry Potter Undergraduate 301 Draco Malfoy Undergraduate 111 Marcus Flynt Graduate

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

2. How were various roles filled?

Answered: 1 week ago