0

getArea and getPerimeter

Does anyone know how to write this program with getArea and getPerimeter? https://code.sololearn.com/cM14X8RJY9Cz/?ref=app

12th Mar 2023, 5:53 PM
Maryam PrhnšŸ‡®šŸ‡·
Maryam PrhnšŸ‡®šŸ‡· - avatar
2 Answers
+ 4
static void area(double radius){ double area = (radius*radius)*3.14; System .out.println("Area of ā€‹ā€‹circle:"+area); return ; } Instead of void you need to use double and you need to return the value of your area: static double getArea(double radius){ //calc area return area; } In your main you need call this method. Hope this helps
13th Mar 2023, 2:34 PM
Denise RoƟberg
Denise RoƟberg - avatar
+ 1
Denise RoƟberg thanks šŸŒø
13th Mar 2023, 10:41 PM
Maryam PrhnšŸ‡®šŸ‡·
Maryam PrhnšŸ‡®šŸ‡· - avatar