Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6. (5 points) Given an object named rectangle, constructed elsewhere, call the s

ID: 3741730 • Letter: 6

Question

6. (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. (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 code. 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 constructors 8. 9. (5 points) Given an object named heart, constructed elsewhere, call the getter method to get the value of the instance variable height and store it in a new int variable called answer 10. (5 points) Given an object named cylinder, constructed elsewhere, call the getter method to get the value of the instance variable radius and store it in a new int variable called value.

Explanation / Answer

6) rectangle.setHeight(3); 7) square.setLength(6); 8) int hold = diamond.getDiagonal(); 9) int answer = heart.getHeight(); 10) int value = cylinder.getRadius();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote