=====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
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 #1
The program asks the user to enter a number.
System.out.print("How many numbers will you enter? ");
int total = scan.nextInt();
But remember, you cannot read from the keyboard unless you have added these lines of code in the right places:
import java.util.Scanner;
Scanner scan = new Scanner(System.in);
|