Modify the app to count the number of guesses the player makes. If the number is 10 or fewer, display Either you know the secret or you got lucky! If the player guesses the number in 10 tries, display Aha! You know the secret! If the player makes more than 10 guesses, display You should be able to do better! Why should it take no more than 10 guesses? Well, with each “good guess,” the player should be able to eliminate half of the numbers. Now show why any number from 1 to 1000 can be guessed in 10 or fewer tries.
What will be an ideal response?
Guessing the middle number in the range of remaining numbers will always eliminate
at least half the numbers (because the number guessed is eliminated as well). Repeatedly
halving 1000 yields the values 500, 250, 125, 62, 31, 15, 7, 3, and 1.
Because at most one element remains after halving 9 times, the user will always be
able to guess by the 10th try.
You might also like to view...
What is the difference between user-based and expert-based evaluation?
What will be an ideal response?
Case-Based Critical Thinking QuestionsCase 8-3Cali Polaris Jet Skis has a Web site for amateur jet skiers. The Web site displays on a computer monitor and a mobile device. However, on the mobile device the fullscreen view is small and difficult to read. Cali would like to design a style sheet appropriate for the smaller screens found on most mobile devices. You have been hired for this task. To begin, you will use a(n) ____ to develop and test Web site designs and create custom mobile Web apps without owning the hardware device.
A. SDK B. Software Development Kit C. emulator D. both a. and b.
You would apply a ________, which is a collection of design choices that includes colors, fonts, and special effects, to give a consistent look to your work.
A. template B. theme C. view D. gallery
?To ensure data validation, concepts must be clearly defined and ranges of acceptable values for representing these concepts must be established.
Answer the following statement true (T) or false (F)