Answer to Question #312366 in Algorithms for KeKo

Question #312366

Create a program that will prompt the user to enter a number in the range 1-100 to find my favorite number. If the number is less than favorite number, print “Too low...guess again: ”. If the number is greater than favorite number, print “Too high...guess again: ”. Otherwise, indicate that the number entered is the correct favorite number. (use a constant)


1
Expert's answer
2022-03-16T07:08:15-0400
Start
  Declare constant integer favoriteNumber=8;
  Declare integer userFavoriteNumber
  Display "Enter a number in the range 1-100 to find my favorite number: "
  Input userFavoriteNumber
  while userFavoriteNumber<>favoriteNumber:
     if userFavoriteNumber<favoriteNumber:
          Display "Too low...guess again: " 
     else   
          Display "Too high...guess again: " 
     end if
     Input userFavoriteNumber
   Display "The number entered is the correct"
Stop

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS