public static double percent(double a, double b) {
return (a * b) / 100;
* I changed parameters from int to double, expecting to return a decimal type number.
This test only accepts parameter multiplied by 1.0, I understand this forces the compiler, but former should have worked.....
Why is this not working?
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Thomas
22 October 2022, 16:47
If you changed a methods signature and you weren't supposed to do so, then validation may not accept that.
+1
Amber Singh Rathour Pandey
23 October 2022, 11:38
So, My way works anyway, right?
It's just that validation quite demanding.
0
Thomas
23 October 2022, 14:52useful
The task creators probably intended you to be aware of integer division.
+1