Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

need some help on these a little contested right now the answers i have are
18 : d
19 : e
20 : c
would appriacte why i am right or wrong thank you
image text in transcribed
image text in transcribed
image text in transcribed
sorry i added the picture of 17 by mistake image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions