Hey, thanks for your input for the code. I tweaked with it and it finally works! Here is what I have:
public class SumAndAverage {
public static void main(String [] args) {
// Object declaration
int number = 1;
int sum = 0;
int average = 0;
int count = 0;
// Indefinite while loop
while (number != 0) {
count++;
System.out.print("Enter number: ");
number = Keyboard.readInt();
sum = sum + number;
average = sum / count;
}
// Results
count = count - 1;
average = sum / count;
System.out.println("The sum of these " + count + " numbers is: " + sum);
System.out.println("The average of these " + count +" numbers is: " + average + " and " + sum%count + " / " + count);
}
}