Interactive Program Exercises

1. Write a program that reads 10 integers from the user, and then prints the maximum, minimum, and average of those values.

2. Read a line of text from the user, and then print the length of the text.

3. Fill in the blanks below:

public class Hey {
    public static void main(String[] args) {
        Scanner scan = ___<*1>___  Scanner(___<*2>___);

        // prompt
        System.out.print("Enter the high temperature yesterday: ");
        int high = ___<*3>___ ;

        // prompt
        System.out.println("The high temp yesterday was " + high);

For <*1>:
A. public
B. void
C. new
D. private

For <*2>:
A. Nothing - leave it blank
B. System.out
D. int

For <*3>:
A. Scanner.nextInt();
B. scan.nextInt();
C. nextInt();