Lesson 4 – If/While

EA Sports called your office. They want you to design their next game

What you will learn:

  • Primarily
    • If activity
    • While activity
  • Secondarily:
    • Integer and string variables
    • Asign activity

Client name:
EA Sports

Process Name:
Guessing Game

Create a game that:

  • Asign a “secret” integer variable between 1-100
  • Take a user input (a number between 1-100)
  • Check if the user input equals the secret variable
  • If yes the user wins
  • Else ask for a new number (and tell the user, if the guess was too high or too low

1 comment

Your email address will not be published. Required fields are marked *

  • It was possible to do without the second assign, and instead specify the immediately converted variable intUserInput in If body.

Newsletter from Anders Jensen