subject

Please HELP QUICK
PUT CODE DOWN BELOW

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

CirclwTester, 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());

}

}

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;
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
This program will store roster and rating information for a soccer team. coaches rate players during tryouts to ensure a balanced team. (1) prompt the user to input five pairs of numbers: a player's jersey number (0 - 99) and the player's rating (1 - 9). store the jersey numbers in one int vector and the ratings in another int vector. output these vectors (i.e., output the roster). (3 pts) ex: enter player 1's jersey number: 84 enter player 1's rating: 7 enter player 2's jersey number: 23 enter player 2's rating: 4 enter player 3's jersey number: 4 enter player 3's rating: 5 enter player 4's jersey number: 30 enter player 4's rating: 2
Answers: 1
question
Computers and Technology, 23.06.2019 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Which of the following is not a way in which trees benefit the environment? a. they remove a significant amount of carbon dioxide from the atmosphere. b. they remove a significant amount of oxygen from the atmosphere. c. their roots hold soil in place, reducing rates of erosion. d. they remove ozone and particulates from the atmosphere. select the best answer from the choices provided a b c d
Answers: 1
question
Computers and Technology, 23.06.2019 05:20
Which operating system is a version of linux?
Answers: 1
You know the right answer?
Please HELP QUICK
PUT CODE DOWN BELOW

The Circle and CircleTester have been create...
Questions
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Chemistry, 18.09.2020 15:01
question
English, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
History, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Biology, 18.09.2020 15:01
question
English, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Chemistry, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Biology, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
Questions on the website: 13722367