Lab3bExample's Code

Created by: Mr. Jeff Goldstein

world

Events

When the world starts
Do:
world.multiplication


Methods

  world.multiplication ( )
    firstNumber = 1 , secondNumber = 1 , product = 1
       // Lab3bExample (multiplication of two numbers resulting in a product)
  // User enters the first number and computer assigns it.
  firstNumber set value to ( ask user for a number question = Enter the 1st number to multiply: )
  // User enters the second number and computer assigns it.
  secondNumber set value to ( ask user for a number question = Enter the 2nd number to multiply: )
  // The product of the two numbers is calculated and assigned.
  product set value to ( ( firstNumber * secondNumber ) )
  // Join the answer and the other two strings to display the concatenated answer.
  multiplyingTurtle say ( I'm the quick "Multiplying Turtle", and I found joined with ( ( product as a string ) joined with as the product. ) ) duration = 5 seconds