The question is in python. Write a random number generator guessing game. The numbers  can be from 1 to 50. And implement the program with functions: main(), introdisplay(), and gamebanner(). Intro display() asks the user to guess a number between 1 and 50 and returns that number to main(). Gamebanner() prints “guessing game computer program” at the start of the program.

Question
Asked Sep 30, 2019
38 views

The question is in python. Write a random number generator guessing game. The numbers  can be from 1 to 50. And implement the program with functions: main(), introdisplay(), and gamebanner(). Intro display() asks the user to guess a number between 1 and 50 and returns that number to main(). Gamebanner() prints “guessing game computer program” at the start of the program. 

check_circle

Expert Answer

Step 1

Program design

The program has three functions – main, gamebanner and introdisplay. The main function calls these functions and uses the input provided by the introdisplay function. Built in input function of python is used to prompt the user for input and receive the input.

Step 2

Program

 

#the introdisplay function

def introdisplay():

    i = input('Please enter a number between 1 and 50: ')

    return i

 

#the gamebanner function

def gamebanner():

    print('Guessing game computer program')

...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: The formulas for calculating BMI are B M I = 703 ⋅ w e i g h t I n P o u n d s/ h e i g h t I n I n ...

A: Program code #1:

question_answer

Q: Construct an unambiguous grammar equivalent to the grammar in  S→AB|aaaB, A→a|Aa, B→b.

A: Solution: Construct an unambiguous grammar to grammar.Given that,S -> AB|aaaBA -> a|AaB -> ...

question_answer

Q: What are the different companies providing NOS- Network Operating System?

A: A network operating system is basically an operating system which is developed to support PCs, works...

question_answer

Q: Create a new file (in Dev C++) . In Lab 2, you created a menu for a simple calculator program. In La...

A: Program Instructions:Declare variables and call the printHelloMsg() function to display a welcome me...

question_answer

Q: Hello! How to create a Pynthon function that strips the first letters from all file names in a direc...

A: Program Instructions:Import the os module and create a function named strip_first_letter().Ask the u...

question_answer

Q: Convert the grammar S → aSb|bSa|a|b|ab into Greibach normal form.

A: A context free grammar  is in Greibach Normal Form (GNF) if all production rules satisfy one of the ...

question_answer

Q: please solve this in python  //////////////// //////////////// //////////////// ////////////////

A: A python program to display the boolean values for the given functions is provided below;Program cod...

question_answer

Q: I don't want the answer, but can you please help me understand what they are asking?  I am having di...

A: Program code:

question_answer

Q: Please help me solve this problem

A: Program design:Since the corner positions are a1,a8,h1,h8 in a chess board and the borders are any p...