next up previous
Next: 2 Recursive Functions Up: APS105S Tuesday Quiz 1 Previous: Instructions

1 Basic Programming Constructs

Write a Turing program that reads in a series of real numbers from the user, three at a time. For each group of three numbers, (call them indvidually A, B, and C, in that order), the program should do the following:

The program should terminate when the first number in a sequence is -1000. It should terminate without reading the last two numbers in a group of three.

You can assume that the inputs will be real numbers. Do not prompt the user for the input.

Use the format shown in the example below. (The ``Input:'' and ``Output:'' are not part of the program input/output, they are just there for readability.)

Input: 82.5 110.3 92.6
Output: 92.6 is in bounds.

Input: 40. 45. 95.
Output: 95 is out of bounds.

Input: -1000.
Output: <program exits>

A solution



Jonathan Rose
Sat Mar 8 17:24:49 EST 1997