0
My code is creating a bug and it's not suppose to
7 Answers
+ 3
Link your code. Without seeing your code, nobody can tell what you did.
+ 1
The variable "bill" is never defined.
"num" is an integer but sc.nextDouble() returns a double.
+ 1
define "num" with the appropriate type.
define "bill" or just use "num" if that is what you intended
0
import java.util.Scanner;
class Demo {
public static void main(String[ ] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextDouble();
System.out.println(bill *15/100);
}
}
0
I'm stick for a few days now
0
So, what is the correct code
0
How