Programming and Computer Science in Java:

See Course Home Page.

**Quiz
Date: Tue, Apr 1, 2003**

__Part 1: Written Portion__

**For this quiz portion, you**__may not__use JCreator.**No notes, no books, no calculators, no talking, etc****Good luck!**

** Question 1:** Write a Java program which reads in an integer N, and prints out whether or not N is
odd.

** Question 2:** Write a Java program which reads in an integer N, and prints out whether or not N is prime.

__ Question 3:__ Write a Java program which repeatedly reads in a positive integer
n (quitting when n <= 0), and prints out n factorial, where n! = n * (n-1) * (n-2) * ... * 1. Thus, 3 factorial, written 3! = 3 * 2 * 1 = 6. And 4 factorial, written 4! = 4 * 3 * 2 * 1 = 24.

** Question 4:** Write a Java program which reads in integers, stopping only when the same integer is entered in twice in a row. Print out the total number of integers read.

__Part 2: JCreator Portion__

**For this quiz portion, you**__may__use JCreator.**No notes, no books, no calculators, no talking, etc****Good luck!**

** Question 5:** Write a Java program which reads in an integer n and prints out the prime factorization of n. That is, the product of prime numbers which equals n. For example, if you read in 45, your program should print out 45 = 3*3*5.
Be sure to get the asterisks right.

** Question 6:** Write a Java program which finds the single-digit numbers a, b, c, and d such that
a

See Course Home Page.