0
How can I do the code of the activity called forms in the java course
My code resolved 4/5 cases and missing case is locked and Is the case three , so i can't see what Is the problem. Help me please it's the last thing i need
8 Antworten
+ 2
Where's the code?
+ 2
Carlos Arturo Diaz Artiaga
Use this.width in the constructors instead of super.width (updated and works)
https://code.sololearn.com/cG8DTo1h47k5/?ref=app
+ 2
While the output of your code is correct, you should use 'this' instead of 'super' as Soumik stated. That being said, there seems to be a bug that if you output the area with parentheses like;
System.out.println((width * width)* Math.PI);
it shows the one test as incorrect, even though the output is the same with them or without. Just remove the parentheses and it should pass.
System.out.println(Math.PI*width*width);
+ 2
Soumik ChaoticDawg Thank you, I could finally finish the course
+ 1
ChaoticDawg Carlos Arturo Diaz Artiaga Yes i just realized that width * width * Math.PI doesn't work but Math.PI * width * width works. They are strictly following the π * r * r formula. Lol
0
Soumik that Is my code
0
Soumik is the same problem brother, cases one, two, four and five are fulfilled but case three is not and I do not know why