Question: A guessing game program generates a random integer between 9 and 9 (inclusive, meaning including 9 and including 9) and then prompts the user for

A guessing game program generates a random integer between 9 and 9 (inclusive, meaning including 9 and including 9) and then prompts the user for an integer from 9 to 9 (inclusive). The program outputs one of the following: - if the random number is 0 , the user gets 0 points no matter what value they entered, so the program outputs "Sorry, you have 0 points since the random number was 0." - if the user input is an integer outside of 9 to 9 (inclusive), the program generates the following message "Sorry you cannot play the game as you entered an invalid integer. Try again." - if the random number is positive, then the user receives points equal to the sum of the input value and the randomly selected number, and the program reports the random number and their points, such as "The random number was 8 so your points are: 1", if, for example, the user entered 9. - if the random number is negative, then the user receives points equal to the product of the input value and the randomly selected number, and the program reports their points, such as "The random number was 8 so your points are: 72 ", if, for example, the user entered 9. Note: To randomly generate a number between and including 9 and 9 , use the randint method from random library module. For example, x= randint (1,100) will automatically generate a random integer between 1 and 100 Note: To randomly generate a number between and including 9 and 9 , use the randint method from random library module. For example, x= randint (1,100) will automatically generate a random integer between 1 and 100 (inclusive) and store it in x. Sample input/output 1: Enter an integer value from 9 to 9 (inclusive): 8 The random number was 2 so your points are: 10 Sample input/output 2 : Enter an integer value from 9 to 9 (inclusive): 7 The random number was 8 so your points are: 56 Sample input/output 3 : Enter an integer value from 9 to 9 (inclusive): 10 Sorry you cannot play the game as you entered an invalid integer. Try again. Sample input/output 4 : Enter an integer value from 9 to 9 (inclusive): 6 Sorry, you have points since the random number was
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
