Question
JAVA ONLY Display a class DegreeWorks. It will be used to tell you which courses you need to complete in order to graduate. It must
JAVA ONLY
Display a class DegreeWorks. It will be used to tell you which courses you need to complete in order to graduate. It must have:
A private ArrayList (Java) or List (C#) of strings called required
A private ArrayList (Java) or List (C#) of strings called completed.
A private method called cs() which adds "CSE1321", "CSE1321L", "CSE1322","CSE1322L" and "CS3305" to the required ArrayList/List.
A private method called it() which adds "CSE1321", "CSE1321L", and "IT1114" to the required ArrayList/List.
An overloaded constructor that takes in a major (string) and an ArrayList/List of courses you have passed.
If the passed in major is CS called the cs() method. If it's IT, call the it() method.
Set the completed ArrayList/List to the values passed in to this constructor.
A method leftToTake() which takes in no parameters and returns void.
It will print out any courses the student has not completed, but is required to take.
In your driver class
Display method called classesTaken which takes in no parameters and returns an ArrayList/List of strings.
Display a new ArrayList/List of strings.
Add to the arraylist CSE1321 and CSE1321L.
Return the collection.
In your main method
Call classesTaken, store the resulting ArrayList/List in a variable.
Instantiate a DegreeWorks object for a CS student with the classes taken from the above method.
Call leftToTake, so it prints out the missing classes.
Sample Output:
Must take:CSE1322
Must take:CSE1322L
Must take:CS3305
JAVA ONLY
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