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 Respuestas
+ 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