Question #263393

class MyClassCircle {

private double radius;

MyClassCircle(double radius) {

this.radius = radius;

}

public double getArea() {

return Math.PI * radius * radius;

}

}


class GetAreaDemo {

public static void main(String [] args) {

MyClassCircle circle = new MyClassCircle(5.6);

System.out.println("Area of the circle with radius 5.6 equal to " + cicle.getArea());

}

}




1. List down the variables you used and it's uses in the program.


2. What is the formula for getting the area of the circle, based on the codes?


Expert's answer

1. List down the variables you used and it's uses in the program.
Answer:
1. double radius 
2. MyClassCircle circle 


2. What is the formula for getting the area of the circle, based on the codes?
Answer:
Area= Math.PI * radius * radius

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS