Lecture 7 Objectives [Nov 03]prev next

OPENING LINE: Howard Roark laughed [The Fountainhead, Ayn Rand]
 


At the end of today's class you should

HAVE READ:

KNOW:

BE ABLE TO:

DAILY QUESTION:


Sample Exam Question:

Write a program where the user types in on a single line a positive number n greater than zero, then types in n numbers separated by spaces followed by pressing Enter. Then output, one per line, each number that had been typed in which was less than 50. In your solution, your main method must be the following (so you must provide the two missing functions).

package nov03;

import java.util.Scanner;

public class SampleQuestion {
  /** Helper methods will appear here. */

	
  /** Incorrect program to show how to swap variable values. */
  public static void main (String []args) {
    Scanner sc = new Scanner(System.in);
    int nums[] = readArray (sc);
    outputLessThan50(nums);
  }
}