Professional Documents
Culture Documents
Exercises
Exercises
Exercises
This time when users enter an incorrect password they get a message saying,
“Incorrect password” followed by a message saying “Please enter your password
If they do enter the password incorrectly after three attempts they get a message
saying, “Access denied” followed by a message saying “Your account has been
locked
Can you implement the program from given algorithm, starter project has been given to help
you?
• You have been asked to modify a simple guessing game. The application works
by allowing a user to guess a number between 1 and 10 randomly chosen by
the computer.
• The program will first generate a random number between 1 and 10 and then
repeatedly prompt for the users guess until they enter a terminating value of
‘q’
• When the user guesses the correct answer an winning message will be
displayed on screen and the program will stop.
• You need to modify the program to give the user hints let them know if their
number is too high or too low
EXTENSION : -
limit number of guesses to 3 display game over you lost message if more
than 3 guesses
SHOPPING LIST
• You have been asked to create an application that allows a user to create a
shopping list when the application is started by entering the values
sequentially until a terminatory value (end) is entered.
• The application must also display each item in the list when the space bar is
pressed.
• Create an algorithm for doing so.
CHECK PASSWORD
• A Requirement has been made to calculate the winning time from a list of
times
• Design an algorithm, to do so
• The requirements have now been extended to require the second best time as
well as the average time
• How might you design an algorithms to do so