Assignment5(1)

docx

School

University of Texas, Rio Grande Valley *

*We aren’t endorsed by this school

Course

1380

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

1

Uploaded by keylym07

Report
CSCI 1380 Yessenia Rodriguez Name: _______________________ Assignment 5 Write a program that generates a random number in the range of 1 through 100 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the program should display the random number and the score, which is the number of tries the user took to guess the number. Then, the user is asked if he/she wants to play again. If they do, the program generates a new random number so the game can start over. When the user decides to stop playing, the average number of tries is displayed as the average score. Additionally, the program should also display the number of games that were ended before correctly guessing the random number. A module should be created for the game operations. The module should have the following functions: Generate random number Display message for “Too high…” or “Too low…” Round of guessing Hint: You should import the random module in the module you create. A sample output is shown below.
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help