subject

Consider the following class declarations. Remember that a postcondition describes the result of executing a method. public class Point
{
private double myX;
private double myY;

//postcondition: this Point has coordinates (0, 0)
public Point()
{ /* implementation not shown */ }

//postcondition: this Point has coordinates (x, y)
public Point(double x, double y)
{ /* implementation not shown */ }

//other methods not shown
}

public class Circle
{
private Point myCenter;
private double myRadius;

//postcondition: this Circle has center at (0, 0) and radius 0.0
public Circle()
{ /* implementation not shown */ }

//postcondition: this Circle has the given center and radius
public Circle(Point center, double radius)
{ /* implementation not shown */ }

//other methods not shown
}
In a separate tester program/class, which of the following correctly declares and initializes Circle circ with center at (29.5, 33.0) and radius of 10.0?

A.
Circle circ = new Circle(29.5, 33.0, 10.0);
B.
Circle circ = new Circle((29.5, 33.0), 10.0);
C.
Point p = new Point(29.5, 33.0);
Circle circ = new Circle(p, 10.0);
D.
Circle circ = new Circle();
circ. myCenter = new Point(29.5, 33.0);
E.
Circle circ = new Circle();
circ. myCenter = new Point();
circ. myCenter. myX = 29.5;
circ. myCenter. myY = 33.0;
circ. myRadius = 10.0;

D
E
B
C
A

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:20
The thickness of a part is to have an upper specification of 0.925 and a lower specification of 0.870 mm. the average of the process is currently 0.917 with a standard deviation of 0.005. determine the percentage of product above 0.93 mm.
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
Which best describes the condition under which the unicode output is the same as plain text ?
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
What type of forensic evidence was recovered during the bomb set off at the new mexico facility on the video that was similar to the evidence obtained at the boston bombings and how did the evidence allow the researchers to connect other pieces of evidence to the same bomb?
Answers: 2
question
Computers and Technology, 25.06.2019 04:40
1. instructions: in your response, make an argument for whether for whether it is better for waketown to build its new wake heights subdivision or to preserve the wake wetlan to preserve the wake wetland preserve. use evidence from at least two of the sources below to support your claim. be sure to introduce your precise claim, develop the claim with evidence from the sources, and demonstrate relationships between ideas. (15 points)
Answers: 2
You know the right answer?
Consider the following class declarations. Remember that a postcondition describes the result of exe...
Questions
question
Mathematics, 15.09.2021 05:30