quizNew's Code

Created by: Jack

world

Events

When the world starts
Do:
world.my first method


Methods

  world.my first method ( )
    No variables
       penguin say Time for a quiz
  world.quiz
  penguin say That's all!


  world.quiz ( )
    answerNumber = 1 , answerBoolean = true , answerString = default string
       // Question #1
  While ( answerNumber != 5 )
       penguin say How many animals in the world? duration = 2 seconds
  answerNumber set value to ( ask user for a number question = Enter the number of animals: )
  If ( answerNumber == 5 )
       penguin say Correct
  penguin.wing_flap times = 2
  Else
    penguin say Incorrect
  // Question #2
  penguin say Are there more chickens than penguins? duration = 2 seconds
  answerBoolean set value to ( ask user for yes or no question = Are there more chickens than penguins? )
  If ( answerBoolean == true )
       penguin say Correct
  penguin turn left 1 revolution
  Else
    penguin say Incorrect
  // Question #3
  penguin say What building are we in?
  answerString set value to ( ask user for a string question = Enter the acronym of the building we are in: )
  If ( either ( answerString == LSRC ) or ( answerString == lsrc ) , or both )
       penguin say Correct
  penguin.wing_flap times = 2
  Else
    penguin say Incorrect