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 is a Network-layer routing technology that enables a group of workstations to share a single registered address?
Talja [164]
Your answer is:
Network Address Translation

I hope this helps! :)
4 0
3 years ago
Hey does anyone know any sites like you tube i can watch on my school chrome book or tell me how to unblock sites cause everythi
Vera_Pavlovna [14]

Answer:

Simple

Explanation:

Phoenix browser

4 0
3 years ago
What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the
inessss [21]

The answer is Click the file tab, then click print, or click the page layout tab.

Sometimes, you may want certain pages or sections to have a different orientation (vertical or landscape layout) from the rest of the content inside. To achieve this, you could either go to the file tab then click print or click the page layout tab and click on the drop down arrow to select the options available.  

4 0
3 years ago
What are some limitations when it comes to testing and ensuring program quality? List at
DedPeter [7]

Answer:

the two limitation i can think about is the efficiency like if there are bugs or glitches or if it can get broken into and the second one is if it is running the correct program or not a lot of people deal with this problem.

Explanation: personally these are the two i can come up with at the moment

4 0
3 years ago
What is a shot sequence
Elan Coil [88]
A shot sequence is the time between when a shot is shot and when it lands
7 0
4 years ago
Other questions:
  • On the UB-04 claim form, the type of bill is identified by a four-digit numerical code. The first digit is a leading zero, what
    10·1 answer
  • The Task Manager cannot be used to turn Services on and off.<br> True or False?
    8·2 answers
  • Make a program that prints each line of its input that mentions fred. (It shouldn’t do anything for other lines of input.) Does
    10·1 answer
  • A technician has been asked to troubleshoot a simple network problem that seems to be caused by software. Which troubleshooting
    7·1 answer
  • What is the recommended procedure for disconnecting an external hard drive to avoid losing data?
    15·1 answer
  • PLEASE HELP ME ASAP ;(
    15·1 answer
  • Assume that Precinct Report is a structured type with these fields,address (a string),and three int fields which are counts of c
    12·1 answer
  • What is the range of addresses for conditional branches in MIPS (K = 1024)?
    6·1 answer
  • 1. The Bank manager is imposing a 10% interest rate on the new salary loan to every account in the BPI Family Bank. (ANSWER SHOU
    15·1 answer
  • Give the names of two different places you might find a number represented in hexadecimal
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!