CMPS-2010 Midterm Exam-1

Write the program described below.

Do your work in your Odin /2010/8 folder.

Name your program: highlow.cpp

Please remember to include all the good qualities of a well-written program.

Programming instructions...
1. Your program will calculate a number based on user input.

2. Your program will have one function outside of the main function.

3. Write your function below the main function.

4. Name your function getHighLow.

5. Your function will receive 3 numbers as arguments.

6. Here's what the function will do...

    If all three numbers are less than 10, return the highest of the three values.

    If any of the numbers are 10 or above, return the lowest of the three values.

7. In the main function...

   • Prompt the user to enter 3 numbers.
   • Call your function.
   • Display the result.
   • Print to the screen only from the main function.
   • The getHighLow function does not display any output.

Format of output:

highlow program
---------------

Please enter 3 numbers: 4 7 6
calculating ...

The result is: 7

program complete.
highlow program
---------------

Please enter 3 numbers: 6 10 4
calculating ...

The result is: 4

program complete.