Answer to Question #263393 in Java | JSP | JSF for Matteo Villamor

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?


1
Expert's answer
2021-11-09T10:20:09-0500
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS