Computers and Technology, 08.01.2020 06:31 MINDYDELANO
1. write a tostring method for this class. the method should return a string containing the radius and area of the circle.
2. write an equals method for this class. the method should accept a circle object as an argument. it should return true if the argument object contains the same data as the calling object, or false otherwise.
3. write a greaterthan method for this class. the method should accept a circle object as an argument. it should return true if the argument object has an area that is greater than the area of the calling object, or false otherwise.
this is what i have but i have one error that i can't figure out how to fix: the error is line 3, where it says private double radius. when i use the suggested fix on netbeans (which changes it to private final double radius) i just another error saying illegal use of expression or something. can someone
public class circle {
{
private double radius;
public circle(double r)
{
radius = r;
}
public double getarea()
{
return math. pi * radius * radius;
}
public double getradius()
{
return radius;
}
public string tostring()
{
string str;
str = "radius: " + radius +
"area: " + getarea();
return str;
}
public boolean equals(circle c)
{
boolean status;
if(c. getradius() == radius)
status = true;
else
status = false;
return status;
}
public boolean greaterthan(circle c)
{
boolean status;
if(c. getarea() >
status = true;
else
status = false;
return status;
}
}
Answers: 3
Computers and Technology, 22.06.2019 11:30
What do character formats do for your document's message? a.set the tone b.provide organization c.provide clarity d.set how texts align with documents
Answers: 2
Computers and Technology, 24.06.2019 15:50
Subscribe to j p g a m e t u b e on you tube ?
Answers: 2
Computers and Technology, 24.06.2019 16:30
Pressing the backspace key deletes the text to the of the insertion point. the left or the right?
Answers: 1
Computers and Technology, 24.06.2019 19:00
In python a floating-point number must be written using scientific notation?
Answers: 1
1. write a tostring method for this class. the method should return a string containing the radius a...
Mathematics, 23.11.2020 21:10
Social Studies, 23.11.2020 21:10
Mathematics, 23.11.2020 21:10
Spanish, 23.11.2020 21:10
Advanced Placement (AP), 23.11.2020 21:10
Biology, 23.11.2020 21:10
Biology, 23.11.2020 21:10
Mathematics, 23.11.2020 21:10
English, 23.11.2020 21:10
Mathematics, 23.11.2020 21:10
English, 23.11.2020 21:10