subject

The Circle and CircleTester have been created, but they have errors. The public and private settings for variables and methods are not all correct. Your job is to go through and fix them. You will need to make edits in both files to get them working correctly, but once complete, your output should match the output below.
Sample Output:
Circle with a radius of 5.0
The diameter is 10.0
The perimeter is 31.41592653589793
CIRCLE. JAVA
public class Circle {
public double radius;
private Circle(double myRadius) {
radius = myRadius;
}
private void setRadius(int myRadius){
radius = myRadius;
}
private double getDiameter() {
return radius*2;
}
public double getRadius() {
return radius;
}
private double getPerimeter() {
return Math. PI*getDiameter();}
private String toString() {
return "Circle with a radius of " + radius;
}
}
CIRCLE TESTER. JAVA
public class CircleTester {
public static void main(String[] args) {
Circle circ = new Circle(10);
circ. radius = 5;
System. out. println(circ);
System. out. println("The diameter is " + circ. getDiameter());
System. out. println("The perimeter is " + circ. getPerimeter());
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:00
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
In deadlock avoidance using banker’s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
question
Computers and Technology, 24.06.2019 12:50
When is it most apprpriate for a development team to change the definition of done
Answers: 1
question
Computers and Technology, 24.06.2019 16:30
Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject after the midsemester exams and the end-of-semester exams. she divides the midsemester and end-of-semester information into two separate worksheets, sheet 1 and sheet 2. how will she rename the two worksheets?
Answers: 2
You know the right answer?
The Circle and CircleTester have been created, but they have errors. The public and private settings...
Questions