Question: In Java Im trying to create a planner instanitated to a list of course objects with a no argument constructor, but Im confused how to
public class Planner The Planner class implements an abstract data type for a list of courses supporting some common operations public Planner Constructs an instance of the Planner with no Course objects in it. Postcondition: This Planner has been initialized to an empty list of Courses. public int size ) Determines the number of courses currently in the list. Preconditions: This Planner has been instatiated. Returns: The number of Courses in this Planner. ,public void addCourse (Course newcourse, int position) Parameters: newCourse the new course to add to the list position - the position (preference) of this course on the list Preconditions: This Course object has been instantiated and 1sposition s items currently in list +1. The nun MAX COURSES Postconditions: The new Course is now listed in the correct preference on the list. All Courses that were originally (e.g. If there are 5 Courses in a Planner, positioned 1-5, and you insert a Course in position 4, the n position 4 will be moved to position 5, and the Course that was in position 5 will be moved to positi Throws: IllegalArgumentException Indicates that position is not within the valid range. FullPlannerExpcetion Indicates that there is no more room in the Planner to record an additional Course. Note 1: position refers to the position in the Planner and not the position in the array. Note 2: Inserting an item in position (items currently_in list+1) is effectively the same as adding the ite
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
