0
[WHAT IS WRONG] A java program that calculates the sum of three integers
7 ответов
+ 2
ruiririririri
pow is method of Math class not Double class
And double is a data type and data type don't have method, data type are just a value.
To get power we use pow() method of Math class so there should be
s = Math.pow(a, 3) + Math.pow(b, 3) + Math.pow(c, 3);
+ 2
ruiririririri
You made mistake in taking user input. This is the way to take user input in java
a = sc.nextDouble();
b = sc.nextDouble();
c = sc.nextDouble ();
+ 2
ruiririririri
There is one more problem, you have used unnecessary { }
Also you are not taking user input
Here is correct code
https://code.sololearn.com/c8HU8uI7Rak5/?ref=app
+ 1
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ Thank you for your help. Have a nice day!
+ 1
Arun Ruban SJ Hi! Thank you for correcting me. Have a nice day.
0
ruiririririri
What's double.pow()
And why +s
double is a data type not a class
Double is a class
0
Hi A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ I wanted to insert an expression that cubes the inputted number. I know it’s wrong. How can I fix it?