Question: ( 1 5 marks ) Write a predicate to interactively guess an odd number from 2 0 0 0 to 4 0 0 0 in
marks Write a predicate to interactively guess an odd number from to in at most tries. In case the user types an even number, the number of tries is reduced by an additional try. After each try, the number of remaining tries should be displayed. Outputs can be obtained with predicates writeX and nl and an input with the predicate readXinteger input will be followed by a The secret number should be hardcoded. For example: game You have t r i e s to gu e s s a number between and You have t r i e s to gu e s s a number between and The number i s l ow er t r i e s r em a in in g You gu e s s e d r i g h t y e s
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
