Question: 1. Write down Java program to implement class UML diagram and methods: 15 Course - courseName : String - sudents : String[] - numberOfStudents :

 1. Write down Java program to implement class UML diagram and

1. Write down Java program to implement class UML diagram and methods: 15 Course - courseName : String - sudents : String[] - numberOfStudents : int + Course(courseName : String) + getCourseName(): String + addStudent(student : String): void + dropStudent(student : String) : void + getStudents() : String[] + getNumberOfStudents : int + clear() : void i. ii. iii. Array students will keep the names of students, consider the names are unique and there are 10 students. addStudent() adds a student in the Course, by adding student if the number is more than the array length, the array length will be doubled to accommodate more students. You can use System.arraycopy utility for it. dropStudent() will drop a student from Course, the empty space due to drop is filled by shifting the remaining students towards the null space and the last array element will be made null. clear() will clear the array list. Add three students S1, S2 and 53 to CSE 215.2, print out those students, then drop student S1 and print out those student list again. iv. v. 2. Considering the following requirements write down a Java program: 30 (1) SpecialNumbers class represents a set of unique integers. Its capacity can be specified at the time of creation and cannot be altered subsequently. It maintains the actual length of the set (i.e., the number of the unique integers). It incorporates a method referred to as conditionalAdd that adds the specified new element to the set by following: (i) If the new element is unique in the set, the new element is added and the length of the set is increased. (ii) The sequence of the added numbers is internally maintained

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!