(a) Write the output of the following Java program fragment, assuming that Scanner has
been properly imported. When prompted, the user enters the following: 1 2 3 4
System.out.print ("Enter four integers: ");
Scanner stdin = new Scanner(System.in);
int num1 = stdin.nextInt ( );
int num2 = stdin.nextInt ( );
int num3 = stdin.nextInt ( );
int num4 = stdin.nextInt ( );
int result;
result = (num1 + num2 + num3 + num4);
System.out.print ("The result is: ");
System.out.println (result);
(b) Write out the changes you would make to above Java program segment to print the average of the four input numbers (Reminder: int division results in losing fractional part)