Download Quiz1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Bernoulli number wikipedia , lookup

Parity of zero wikipedia , lookup

Collatz conjecture wikipedia , lookup

0.999... wikipedia , lookup

Exponentiation wikipedia , lookup

Division by zero wikipedia , lookup

Transcript
COMP 131: Object-Oriented Programming with Java
Spring 2007
In-lab Quiz 1
1- Write a Java application called ArithMeanMaxMin.java that asks the user to enter
exactly five integers. It must determine the maximum, minimum and arithmetic mean of
the maximum and the minimum of these five numbers and print the result. The program’s
output should look like the following:
Please
Please
Please
Please
Please
enter
enter
enter
enter
enter
the
the
the
the
the
first integer: 4
second integer: 16
third integer: 2
fourth integer: 7
fifth integer: 9
The minimum number is 2
The maximum number is 16
The arithmetic mean of these numbers is 9
Note: Arithmetic mean of two numbers A and B is
A B
2