Problem 14

# Problem 14 - ECOR1606 Problem Solving and Computers Page 1...

This preview shows pages 1–2. Sign up to view the full content.

ECOR1606 Problem Solving and Computers Page 1 of 2 Department of Systems and Computer Engineering, Carleton University Summer 2003 Assignment – High/Low Write a program that will guess any integer number that you think of that is between 0 and 30,000. The program should work intelligently (i.e. not randomly guessing, nor trying each value one at a time). The first guess the program should make is midway between 0 and 30,000 (i.e. 15,000). The program will ask the user whether this number is correct, too high, or too low, and the user will enter the character ‘C’, ‘H’, or ‘L’ to these conditions, respectively. If the guess is correct the program is complete. If the guess is too high then the program should realize that the number is somewhere between 0 and 14,999. If the guess is too low then the program should realize that the number is somewhere between 15,001 and 30,000. The program should always guess a value that is midway in the possible range of values,

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

Problem 14 - ECOR1606 Problem Solving and Computers Page 1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online