0
What's the error in this code?
public class ReadingInput { public static void main (String [] args) { int FirstNumber; int SecondNumber; Scanner kb = new Scanner(System.in); System.out.println("please enter first number"); FirstNumber = kb.NextInt(); System.out.println("please enter Second number"); SecondNumber = kb.NextInt(); double average = (FirstNumber + SecondNumber )/ 2.0; System.out.println("the average is:" + average ); } }
2 Réponses
+ 2
import java.util.Scanner;
Put ^ at the top of the program.. Second, change both of your
NextInt()
to
nextInt()
Lowercase n
+ 1
thanks Rick👍