Question: Define a class named Student. A Student object represents a university student that, for simplicity, just has a name, ID number, and number of
Define a class named Student. A Student object represents a university student that, for simplicity, just has a name, ID number, and number of units earned towards graduation. Each Student object should have the following public behavior: new Student (name, id) Constructor that initializes a new Student object storing the given name and ID number, with 0 units. s.getName() s.getID () s.getUnits() Returns the name, ID, or unit count of the student, respectively. A s.increment Units (units); Adds the given number of units to this student's unit count. . s. hasEnoughUnits() Returns whether the student has enough units (180) to graduate. . s. toString () Returns the student's string representation, e.g. "Nick (#42342)". Write a class Stanford Lawyer to accompany Employee and the other law firm classes. Stanford lawyers are like normal lawyers, but they make 20% more money than a normal lawyer, they get 3 days more vacation, and they have to fill out four of the lawyer's forms to go on vacation. That is, the getVacationForm method should return "pinkpinkpinkpink". Make sure to interact with the superclass as appropriate. Write a method named SwitchPairs that accepts an ArrayList of strings as a parameter and switches the order of pairs of values in the array. Your method should swap the order of the first two values, then switch the order of the next two, and so on. For example, if the array stores {"a", "bb", "c", "ddd", "ee", "f", "g"}, then the call of switchPairs (a); should switch the first pair ("a", "bb"), the second pair ("c", "ddd") and the third pair ("ee", "f"), to yield this list: {"bb", "a", "ddd", "c", "ee", "f", "g") If there are an odd number of values, the last element is not moved.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
