1. (2 points each) Create the following objects as described below. Use any name
ID: 3741728 • Letter: 1
Question
1. (2 points each) Create the following objects as described below. Use any name a. Create an object of type Homework, named homework1, using a constructor that does not take in any arguments. b. Create an object of type School, named mySchool, using a constructor that takes in three String arguments. Use "University”, “of”, and “Oklahoma” as those arguments. c. Create an object of type Semester, named spring, using a constructor that takes in two arguments: the string "Spring” and the int 2016. d. Create an array of 5 Grade objects, named ray. (Leave them as initialized to the default value). 2. (2 points) What should the name of a getter method for the class variable "numberOfQuestions” be? 3. (2 points) What should the name of the setter method or the class variable "totalPoints” be?Explanation / Answer
Question 1a)
Answer:
HomeWord homeword1 = new HomeWork();
Question 1b)
Answer:
School mySchool = new School("University","of","Oklahoma");
Question 1c)
Answer:
Semester spring = new Semester("Spring",2016);
Question 1d)
Answer:
Grade ray[] = new Grade[5];
Question 2)
Answer:
public int getNumberOfQuestions() {
return numberOfQuestions;
}
Question 3)
Answer:
public void setTotalPoints(int t) {
totalPoints = t;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.