Java HW help, please! 4. (5 points) All of the method calls in 3b - e were non-s
ID: 3916639 • Letter: J
Question
Java HW help, please!
4. (5 points) All of the method calls in 3b - e were non-static. Re-write each of these method calls using the static method signatures below. a. public static int[l getGrades0 b. public static void ringBell0 c. public static double getAverage(String subject) d. public static Stringl getPrintQueue(int maxLength) 5. (5 points) Given an object named rectangle, constructed elsewhere, call the setter method to set the instance variable height to 3. You will only need to include the one method, do not worry about constructing the object or any other component of the code. 6. (5 points) Given an object named square, constructed elsewhere, call the setter method to set instance variables length to 6. Again, do not worry about constructing the object or any other component of the codie 7. (5 points) Given an object named diamond, constructed elsewhere, call the getter method to get the value of the instance variable diagonal and store it in a new int variable called hold. This is still just one method call, no constructorsExplanation / Answer
5. rectangle.setHeight(3);
6. square.setLength(6);
7. hold = diamond.getDiagonal();
8.answer = heart.getHeight();
9. value = cylinder.getRadius();
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.