Programming and Computer Science in Java:
Quiz #4b:   Lab #1, Exercises 1-24
    David Kosbie, 2002-2003
See Course Home Page

Quiz Date:  Wed, Mar 12, 2003

 This document is also available as quiz4b.doc.

Question 1: Write a Java program which reads in two integers, and prints out the integers which are between them. Your program must work whether the first or second number is the smaller one. 

Question 2: 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.

Question 3: Write a Java program which first reads in an integer N, followed by N more integers, and then prints out the following information (not counting the number N in your statistics):
a) The largest integer entered;
b) The smallest integer entered;
c) The sum of all the integers entered;
d) The average of all the integers entered. 


See Course Home Page