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, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
question
Computers and Technology, 22.06.2019 10:30
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
Consider the following class declarations. Remember that a postcondition describes the result of exe...
Questions
Questions on the website: 13722359