Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public class CircleTester { public static void main(String[] args) { Circle circ = new Circle(10); circ.radius = 5; System.out.println(circ.toString()); System.out.println(The diameter is + circ.getDiameter());

image text in transcribed

image text in transcribed

image text in transcribed

public class CircleTester { public static void main(String[] args) { Circle circ = new Circle(10); circ.radius = 5; System.out.println(circ.toString()); System.out.println("The diameter is " + circ.getDiameter()); System.out.println("The perimeter is " + circ.getPerimeter()); } public class Circle { public double radius; public double getRadius() { return radius; } public void setRadius(int myRadius) { radius = myRadius; } public Circle(double myRadius) { radius = myRadius; } public double getDiameter() { return radius*2; } public double getPerimeter() { return Math.PI*getDiameter(); } public String toString(){ return "Circle with a radius of " + radius; } 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago