Working out the odd/even problem in steps

=====Sum and average all of the odd and even numbers entered by the user.
When the program runs it should look like this:

How many numbers will you enter? 3
Enter number 1: 20
Enter number 2: 25
Enter number 3: 44

The odd numbers are 25
The total of the odd numbers is 25, the average is 25

The even numbers are 20 44
The total of the even numbers is 64, the average is 32

Step #2

The program asks the user to enter a number. Let's call this number n (Look at step 4 to find out where n comes from)

System.out.print("Enter number "+ n + ": ");
int num = scan.nextInt();

READ THIS CODE, BUT DON"T USE IT!
Each time a number is entered 2 things happen

1. It is added to a running sum
      sum = sum + num;
    
2. It is added to a number string (concatenation)
      numberString = numberString + num;
    

But remember, the sum and number string must be created before you can add anything to them.

int sum = 0;
String numberString = ""; // This is an empty string

But wait! There are 2 different sums and 2 different strings!! Go on to step 3 to figure out how to deal with those.

<-- Previous