Professional Documents
Culture Documents
Activity 6-
Guesser Game
Some of this data is constant because, since it is already declared, it does not change
once it is established.
Why do you think the constants are used in the
definition of line 7 and line 9?
In these lines, constants are used to declare values that should not change in
the program. The variable numeroJugadas is set to 10 to limit the number of
player attempts, and minimum is set to 1 to set the minimum value for the
magic number.
Explain lines 34 to 35
Lines 34 and 35 are part of the create NumeroMagico method in the Riddle
class. These lines create a random magic number within the specific range.
From line 34 to 35, suppose that the maximum=100 and
minimum=200, what possible values would Magic
number have?
From line 34 to 35, suppose that the maximum=90 and
minimum=110, what possible values would the magic
number have?
In these two cases there are no possible valid values for the magic
number, since maximum must be greater than minimum, possible values
could not be generated for magic number.
How would you cheat on the game? What
instructions would you put in the code to perform
the trap?
I would cheat the game by modifying the code, I would remove the else where it
gives the indication that the number is incorrect and thus I would win.