Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Class Diagram: The class is described by the UML (universal modeling language) diagram below. Course MAX SECTION SIZE: int - 50 - code: Strinel
Java
Class Diagram: The class is described by the UML (universal modeling language) diagram below. Course MAX SECTION SIZE: int - 50 - code: Strinel name: String - numStudents: int - numSections: int Course info:Stringi calcNur Sections numStudents:int): int + getCodel : String[] +getName(): String + getNumStudents(): int getNumSections(): int + toString): String Recall that a class diagram consists of three compartments containing the following information: Top: class name Middle: fields Bottom: method signature's The plus and minus signs represent access modifiers. A plus means that a field or method is public, while a minus means that it is private. An underlined identifier means that a field or method is static. Field Info: MAX_SECTION_SIZE: a constant that stores the maximum number of students that can be enrolled in a section. Set this field equal to 50. code: a two-element array containing the subject abbreviation and the course number. For instance, the code for our course is "CS 2334", so the code field would be ["CS","2334"). name: the name of the course le.c. "Programming Structures and Abstractions"). numStudents: the number of students enrolled in the course. numSections: the number of sections offered for the course. Constructor Info: The constructor is given a String that specifies the course code, name, and number of students. This information is separated by commas. For example, to create an object for our course, we would pass the constructor the String 'CS 2334.Programming Structures and Abstractions, 118". (Note that there are no spaces on either side of each comma.) The constructor must split the String and assign each piece of information to the corresponding field. Method Info: calcNumSections. This method is used by the constructor to calculate the number of sections from the number of students. Assume that only one section can be partially full. For example, if there are 148 students in the class, there must be 3 sections. getCode: This method returns a copy of the code field. A copy must be returned because Course objects should be immutable. (Note that the class diagram does not have any mutator methods.) .toString: This method returns a String with all of the course information. The String should have the following format: "CODE:Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started