1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kondaur [170]
3 years ago
7

Overview In this assignment, you will gain more practice with designing a program. Specifically, you will create pseudocode for

a higher/lower game. This will give you practice designing a more complex program and allow you to see more of the benefits that designing before coding can offer. The higher/lower game will combine different programming constructs that you have been learning about, such as input and output, decision branching, and a loop. IT 140 Higher/Lower Game Sample Output Overview Maria has asked you to create a program that prompts the user to enter the lower bound and the upper hound. You have decided to write pseudocode to design the program before actually developing the code. When run, the program should ask the user to guess a number. If the number guessed is lower than the random number, the program should print out a message like "Nope, too low." if the number guessed is higher than the random number, print out a message like "Nope, too high." If the number guessed is the same as the random number, print out a message like "You got it!" Higher/Lower Game Description Your friend Maria has come to you and said that she has been playing the higher/lower game with her three-year-old daughter Bella. Maria tells Bella that she is thinking of a number between 1 and 10, and then Bella tries to guess the number. When Bella guesses a number, Maria tells her whether the number she is thinking of is higher or lower or if Bella guessed it. The game continues until Bella guesses the right number. As much as Maria likes playing the game with Bella, Bella is very excited to play the game all the time, Maria thought it would be great if you could create a program that allows Bella to play the game as much as she wants. Note: The output messages you include in your pseudocode may differ slightly from these samples. Sample Output Below is one sample output of the program, with the user input demonstrated by bold font. Prompt For this assignment, you will be designing pseudocode for a higher/lower game program. The higher/lower game program uses similar constructs to the game you will design and develop in Projects One and TWO. Welcome to the higher/lower game, Bella! Enter the lower bound: 10 Enter the upper bound: 30 Great, now guess a number between 10 and 30: 20 Nope, too low Guess another number: 25 Nope, too high Guess another number: 23 You got it! Below is another sample output of your program, with the user input demonstrated by bold font 1. Review the Higher/Lower Game Sample Output for more detailed examples of this game. As you read, consider the following questions: What are the different steps needed in this program? How can you break them down in a way that a computer can understand? What information would you need from the user at each point (inputs)? What information would you output to the user at each point? When might it be a good idea to use 'F' and "IF ELSE' statements? When might it be a good idea to use loop? 2. Create pseudocode that logically outlines each step of the game program so that it meets the following functionality: Prompts the user to input the lower bound and upper bound. Include input validation to ensure that the lower bound is less than the upper bound. - Generates a random number between the lower and upper bounds Prompts the user to input a guess between the lower and upper bounds. Include input validation to ensure that the user only enters values between the lower and upper bound. Prints an output statement based on the puessed number. Be sure to account for each of the following situations through the use of decision branching . What should the computer output if the user guesses a number that is too low? . What should the computer output if the user guesses a number that is too high? - What should the computer output if the user guesses the right number? Loops so that the game continues prompting the user for a new number until the user guesses the correct number. Welcome to the higher/lower game, Bella! Enter the lower bound: 10 Enter the upper bound: 5 The lower bound must be less than the upper bound. Enter the lower bound: 10 Enter the upper bound: 20 Great, now guess a number between 10 and 20: 25 Nope, too high Guess another number: 15 Nope, too low. Guess another number: 17 You got it! Sutrnil your completed pseudocode as a Word document of approximately 1 to 2 pages in length.
Computers and Technology
1 answer:
zubka84 [21]3 years ago
3 0

Answer:

<u>Pseudocode</u>

lower = upper = 0

while lower > upper

   input lower

   input upper

   if lower > upper

       print "Lower bound is greater than upper bound"

randNum = generate_a_random_number

print "Guess a number between",lower,"and",upper

input num

while num <> randNum

   if num > randNum:

       print "Nope, too high"

   else:

       print "Nope, too low"

   input num

print "Great; you got it!"

<u>Program in Python</u>

import random

lower = upper = 0

while True:

   lower = int(input("Lower Bound: "))

   upper = int(input("Upper Bound: "))

   if lower < upper:

       break

   else:

       print("Lower bound is greater than upper bound")

randNum = random.randint(lower, upper)

print("Great; now guess a number between",lower,"and",upper)

num = int(input("Take a guess: "))

while num != randNum:

   if num > randNum:

       print("Nope, too high")

   else:

       print("Nope, too low")

   num = int(input("Take another guess: "))

print("Great; you got it!")

Explanation:

Required

Write a pseudocode and a program to design a higher/lower game

<em>See answer section for the pseudocode and the program (written in Python)</em>

The pseudocode and the program follow the same pattern; so, I will only explain the program.

See attachment for complete program file where comments are used to explain each line.

Download txt
You might be interested in
What are parts of the prewriting process
Ket [755]

Solution:

In composition, the term prewriting refers to any activity that helps a writer think about a topic, determine a purpose, analyze an audience, and prepare to write. It is closely related to the art of invention in classical rhetoric.

These are the parts of prewriting process:

• Prewriting. You're ready to start writing. ...

• Writing. Now you have your plan and you're ready to start writing. ...

• Revision. Your story can change a great deal during this stage. ...

• Editing. You have overhauled your story. ...

• Publishing.

This is the required answer.

7 0
3 years ago
Why entity relationship model is used for data manipulation??<br><br>​
MrMuchimi

Answer:

An entity relationship diagram gives a snapshot of how these entities relate to each other. You could call it the blueprint that underpins your business architecture, offering a visual representation of the relationships between different sets of data (entities)

<em>Hope u got it </em>

<em>If you have any question just ask me</em>

<em>If you think this is the best answer please mark me as brainliest</em>

<em></em>

8 0
3 years ago
A client calls to complain that his computer starts up, but crashes when Windows starts to load. After a brief set of questions,
melomori [17]

Answer:

It may be that the amount of ram is not compatible with that computer, it may not support ram that is over 8 GB or higher, it may not be properly installed in the hardware, or the motherboard may not be able to read it.

Explanation:

Hardware and software is very unbalanced when it comes to new RAM being installed, as people complain about this exact same issue many times.

5 0
4 years ago
Write a program to help a local restaurant automate its breakfast billing system. The program should do the following:
Maurinko [17]

Answer:

Please find the code and its output in the attached file:

Explanation:

In this code a structure "menuItemType" is defined that declared float and integer variable and outside the structure its list type variable "menuList" is defined that holds and calculates its value.

In the next step, a class "Rest" is defined, and inside the class a method "getData", "showMenu", and "printCheck" is defined, in which the above methods uses the switch for input and calculate the value and the last "printCheck" calculates the Tax and Amount Due value.

In the main method, a class object is created that prints message and call the above method.

6 0
3 years ago
Look at the graph. What is the meaning of the point shown with a star
RUDIKE [14]
The answer is B. 1 Box= 1/2 Pounds
4 0
3 years ago
Other questions:
  • Technician A says one disadvantage of fiber optic cables is that they are more expensive and very heavy. Technician B says one d
    6·1 answer
  • Are MP3 files are quick to transfer.
    11·1 answer
  • A field with the extend data type can contain an attached file, such as an image, document, chart, or spreadsheet.
    6·1 answer
  • How to get the home button on your screen?
    13·1 answer
  • A user brings a technician a mobile device that has no sound. What should a technician check for first?
    5·1 answer
  • Just took a test and I got 5 wrong and I wanted to know the correct answers
    10·1 answer
  • Discuss any five factors that hinder the application of a computer in business organisations​
    15·2 answers
  • Answer if you know Javascript, html, css, python, and Ruby.
    12·1 answer
  • Explain why this product was created?
    7·1 answer
  • You are configuring a network and have been assigned the network address of 221.12.12.0. You want to subnet the network to allow
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!