CSCI 1103 Columbus State College Hi & Low Guessing Game Python Lab 7 Assignment: Lab Exercise 7 Python: Hi/Low Guessing Game Python Assignment The objec
CSCI 1103 Columbus State College Hi & Low Guessing Game Python Lab 7 Assignment: Lab Exercise 7
Python: Hi/Low Guessing Game
Python Assignment
The objectives of this lab assignment are as follows:
Declare variables
Use comments
Receive input from the user
Output data to the console
Apply conditional logic
Convert string value to int
Use the Random library
Use while loops
Assignment User Story
As a user I want an application that will allow a user to play the hi/low guessing game where the computer picks a number from 1 to a maximum inputted value and your task as a user to guess the number the computer generates.
Assignment Requirements
In this application you will first randomly generate a number unknown to the user, and the user will guess what that number is and will continue to guess until their guess matches the randomly generated number.
This assignment combines operations of prompting and receiving input from the user with conditional logic to perform a specific function based on those inputs. This assignment outputs information back to the user, and finally, loops through these operations until the user ends the application.
Program flow
You must receive the maximum number that the application will use in choosing its random number. Your application will then generate a random number from 1 to the maximum value the user keyed in (inclusive of that value).
The remaining sequence will be contained within a loop where the user will be asked to guess the randomly generated number. If what the user enters is a match, then the user will be congratulated on guessing the correct number. Otherwise, the user will be informed whether their guess is higher or lower than the actual value.
Once the user guesses the randomly generated value they will be asked if they wish to play another game. If they answer in the affirmative the game will begin anew, otherwise the application will end.
This application contains two loops: one within the other—an inner loop and an outer loop. The outer loop control’s subsequent game play in that the user is prompted if they wish to play the game again. The inner loop causes the user to be prompted to guess the randomly generated number. The inner loop continues until the user’s guess matches the computers number. The outer loop continues until the user no longer wishes to play the game.
Important:
When complete, your output should appear as pictured below:
Notice that if users affirm they wish to play again, the game starts over from the beginning:
Technical/Grading Requirements
You must ensure that the application you submit meets all the technical/grading requirements. Your grade will be based on how well your application follows these requirements:
The name of your application will be HiLoGame.py
You must have a set of comments at the top of the program that identifies the programmer, date, and name of the program file. Furthermore, you must provide a description of what this program is and what it does. Each of these comments must be on individual lines.
Your program must contain two loops: an outer and an inner. Hence, you will be working with the concept of “nested” loops. The outer loop controls the next game play, while the inner loop controls the current game play.
You must randomly generate a number from 1 to the maximum value the user enters at the start of the game.
Optional
Can you validate that numeric entries made by the user are indeed numeric? This is to say that the program should not end with an exception error due to the user inputting invalid data. Hint: this is accomplished through use of while loops that continue to prompt the user until their entry is valid.
This is optional for this assignment but will be a requirement of your next application. As such, this would be a great opportunity to begin exploring this concept.
In the screen capture below, you can see that I have protected the application against invalid numeric entry:
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. Even if we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency. If you want a cheap essay, place your order in advance. Our prices start from $11 per page.