Docsity

Guessing Game Exercises, Summaries of Computer science

Toggle sidebar
bg1
Exercise 6.1
n i
10 10
10 5
10 6
10 3
10 4
10 2
10 1
10 2
10 1
10 2
10 1
10 2
10 1
10 2
10 1
10 2
10 1
10 2
10 1
10 2
Exercise 6.2
1. False, if the first letter of the answer is y then the condition will match.
2. 1
3. Get the users answer y
4. Y, higher, lower
5. The guess is wrong, and the guess number is too small
6. Mid n is used to find the median number between the range, max n is used to
indicate that the maximum range is this value and min n implies that the current
lowest value is that number.

Partial preview of the text

Download Guessing Game Exercises and more Summaries Computer science in PDF only on Docsity!

Exercise 6. n i 10 10 10 5 10 6 10 3 10 4 10 2 10 1 10 2 10 1 10 2 10 1 10 2 10 1 10 2 10 1 10 2 10 1 10 2 10 1 10 2 Exercise 6.

  1. False, if the first letter of the answer is y then the condition will match.
  2. 1
  3. Get the users answer y
  4. Y, higher, lower
  5. The guess is wrong, and the guess number is too small
  6. Mid n is used to find the median number between the range, max n is used to indicate that the maximum range is this value and min n implies that the current lowest value is that number.