Difficulty: Easy
Time to solve: <5 min
Video this is covered in: 2
import java.util.Scanner;
public class Jtutorial1 {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
double a=0, b=1, c=2, d=3;
System.out.println("Enter a value for E: ");
double e= input.nextDouble();
System.out.println("Enter a value for F: ");
double f;
System.out.println(a+b+c+d+e+f);
}//end main
}//end class
Input:
10000
5
Error information:Exception in thread “main” java.lang.RuntimeException: Uncompilable source code – variable f might not have been initialized
at Jtutorial1.main(Jtutorial1.java:14)