Question: c + + 'Write your codes inside Q 1 function block which simulates a letter - guessing game. When the program starts, it accepts a
c '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 a to zodd or A to Zeven
Odd Version odd th digit in student ID
Sample display
k
f
f to z
m
k
f to m
Correct
Even Version even th digit in student ID
Sample display
K
F
F to Z
M
F to M
K
Correct
Sample display
Sample display
h
d
d to z
q
d to q
c
Game over
H
D
D to Z
Q
C
D to Q
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 NO prompt messages and NO 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
