Question: Question 1 ( 3 0 % ) Write your codes inside Q 1 function block which simulates a letter - guessing game. When the program
Question
Write your codes inside Q function block which simulates a letterguessing game. When the
program starts, it accepts a secret letter from the first user. Then, the second user attempts to
guess the letter. The program provides feedback after each guess, showing the new range of
possible letters based on whether the guessed letter is alphabetically higher or lower than the
secret letter. The game continues until the correct letter is guessed or the second user enters a
letter outside the new range provided by the program.
You can assume that the users always enter one character in each round of input, which is
always a letter from
to
Sample display
K
F
F to Z
M
F to M
K
Correct
Sample display
H
D
D to Z
Q
D to Q
C
Game over
IMPORTANT NOTE: Compare your program output with the sample display. Any output
messages from the program should match exactly spelling and use of spaces with that shown
in the sample display. There should be prompt messages and additional blank lines in
the output. DO NOT add extra text in the output which will be considered as incorrect in
marking.
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
