Question: need some help on these a little contested right now the answers i have are 18 : d 19 : e 20 : c would


19. The default constructor sets x and y to (0,0) by calling the second constructor. What could be used to replace / missing code */ so that this works as intended? a b = = 0; 0; this(0, 0); this (x, y); a = b = x; y; x y = a; = b; 20. Which of the following correctly implements a mutator method for point? a. public double getX() { return x; public double getX() { return a; public void setCoordinates (double a, double b) { X = a; y = b; public void setCoordinates (double a, double b) { Point p = new Point (a,b); e. None of the above culesive 17. Consider the following class definition. public class Whatsit private int length; private int width: public int getArea() { // implementation not shown 1 im private int get Perimeter () { // implementation not shown A child class Thingy that extends Whatsit would have access to: a. getArea() b. getPerimeter() c. width, length, getPerimeter() d. width, length, getArea() e. all of the above 18. Which of the following correctly implements the equals method? public boolean equals (Point p) { return (x == Point. && Y == Point.y); public void equals (Point p) { System.out.println(x == p.x && y == p.y); public boolean equals (Point p) { System.out.println(x == p.x && y == p.y); public boolean equals (Point p) Term 2. Unit 6 AP Computer Science A Questions 18 - 20 pertain to the following class, Point: public class Point{ private double x; private double y; public Point() { this (0, 0); public Point (double a, double b) { /* missing code */ 1 ... other methods not shown
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
