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 20:00
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
question
Computers and Technology, 25.06.2019 04:30
What is the purpose of network permissions? a)to control access to network resources b)to convert to wireless networking c)to enable the installation of nics d)to reduce operating costs
Answers: 1
question
Computers and Technology, 25.06.2019 08:50
A-12.3 an american spy is deep undercover in the hostile country of phonemia. in order not to waste scarce resources, any time he wants to send a message back home, he removes all the punctuation from his message and converts all the letters to uppercase. so, for example, to send the message, “abort the plan! meet at the dark cabin.” he would transmit given such a string, s, of n uppercase letters, describe an efficient way of breaking it into a sequence of valid english words. you may assume that you have a function, valid(s), which can take a character string, s, and return true if and only if s is a valid english word. what is the running time of your algorithm, assuming each call to the function, valid, runs in o(1) time?
Answers: 3
You know the right answer?
The Circle and CircleTester have been created, but they have errors. The public and private settings...
Questions
question
Mathematics, 17.11.2020 01:00
question
Physics, 17.11.2020 01:00
question
Mathematics, 17.11.2020 01:00
question
Mathematics, 17.11.2020 01:00
Questions on the website: 13722362