0
Please I need help on this
https://sololearn.com/compiler-playground/cJKo13yM89t7/?ref=app
4 Réponses
+ 4
For starters, you named your function conv(). But when you try to call it, you use convert(). Secondly, you are not passing any parameters to convert() when you do call it. That function is expecting a double and an int. You declared two ints, x & y, one needs to be a double.
1. Rename your function to convert
2. Change int x to double x
3. Pass those to the function call: convert(x, y)
static void conv(double x,int y){
double res= x*12;
System.out.println(res);
}
public class Program
{
public static void main(String[] args) {
int x = 12;
int y = 6;
convert();
}
}
+ 2
The static method should also be within the class, and not outside the class.
+ 2
I copied your code only to highlight where the problems were. I did not write your solution. I explained your mistakes. That is your code.
0
Jerry Hobby Ur code is what I wrote before