Professional Documents
Culture Documents
OBJECTIVES:
This long exam aims to further evaluate your understanding of the programming concepts that we have discussed in
the context of Python. For this, a big component of the task would be to properly identify the applications of the various
concepts in an actual programming problem within a time constraint. Here are the topics covered by this exam:
GENERAL INSTRUCTIONS:
Your main task is to create a program that will allow a user to play one level of the classic game, Hangman. You
can get as creative as you like about the execution but the main components for evaluation would be the syntax,
semantics, logic, execution and documentation of your output.
• Total Score for this exam is 100 pts, and passing score is 60 pts.
• Your program should execute correctly with no errors, your code should be well written, and the comments
should clearly explain what the code is accomplishing. Comments are not needed for every line, but it is
expected for every significant block of code.
• Your code should exhibit effective sequencing, choice, and application of control structures to be demonstrated
by producing the correct results. If you are unsure as to how to start, you can create a flow chart of how hangman
works. This can then serve as your guide as you write your code. This part is not required but I will give
partial points if you submit your flowchart to me (even if your code is not working). You can use draw.io
for this.
• This exam is individual. You are free to search the internet for methods and for solutions to problems you might
encounter during the exam. Just make sure to keep track of time.
• Submit your code before the time limit ends. If you created a flow chart, save it as an image and put it in a
compressed folder along with your code.
• Format your filename for submission with grade_lastname_firstname.py
HANGMAN:
Hangman is a type of guess-the-word game where a player is given a word to figure out and each turn is an opportunity
to guess one letter of the word. If the guess is correct, the instances and respective placements of the letter is revealed,
otherwise, the player gets closer to being ‘hanged’. For your version of the game, here are the specifications that you
should have:
• The word to be guessed is hard coded and your code should be able to handle a word of any realistic length for
as long as there are no spaces.
• Your game should have a quick title, an indicator that it has started, and appropriate prompts that would let the
user know what to do next.
• There should be error handling for multiple character inputs and repetition of characters. For this, there is no
need to display the available letters, but you are free to do so. In addition, your game should not be case
sensitive.
• Progress on both the word and the hanging status should be available for every user turn. You can use this
ASCII based hangman graphics from github. Those are basically multi-line strings inside a list.
• The game ends when the user either guesses the word correctly or gets hanged. For this, your game should
have an indicator on whether the player has won or lost.
SAMPLE PROGRAM OUTPUT:
REFERENCES:
Horton, C. (2017). Chris Horton Github : Hangman ASCII Art and Wordbank. Retrieved from Github:
https://gist.github.com/chrishorton/8510732aa9a80a03c829b09f12e20d9c