Final answer:
Here is an updated version of your code that fixes the errors and produces the correct output.
Step-by-step explanation:
The code provided has a few errors. Here is an updated version of your code:
import java.util.Scanner;
public class LabProgram {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int total = 0;
int count = 0;
int maximum = 0;
int number;
while (true) {
number = scnr.nextInt();
if (number < 0) {
break;
}
if (count == 0) {
maximum = number;
}
if (number > maximum) {
maximum = number;
}
total += number;
count++;
}
System.out.println((total/count) + " " + maximum);
scnr.close();
}
}