Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

Prompt

write 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.


  • 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 "IF" and "IF ELSE" statements?
  • When might it be a good idea to use loops?
  •  
  1. 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 guessed 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.

Step by Step Solution

3.46 Rating (169 Votes )

There are 3 Steps involved in it

Step: 1

Heres a pseudocode outline for a higherlower game program that meets the described functionality 1 P... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Foundations of Financial Management

Authors: Stanley Block, Geoffrey Hirt, Bartley Danielsen, Doug Short, Michael Perretta

10th Canadian edition

1259261018, 1259261015, 978-1259024979

More Books

Students also viewed these Programming questions

Question

How would you describe the work atmosphere?

Answered: 1 week ago