CS10 PHP Quiz March 10

  1. Create a variable named ‘items’ with a value of 100.9
  2. Create an associative array with indexs “name”, “age”, “height” and values of “jose”, 28, “128cm” respectively, then assign it to a variable named ‘person’.
  3. Using the variable in #2, print the value of index ‘name’.
  4. Write an If statement that checks if the variable in #1 is greater than 50 then print “You have enough balance.”
  5. Using Foreach, loop each items in #2 and print their values.
  6. Create a class Ball with public property color and owner with public function named bounce.
  7. Create a new variable ‘spalding’ that reference to the class of #6.
  8. Use the variable in #7 and assign a value of “red” to property color
  9. Call the function bounce in variable #7
  10. Use the variable in #7 and assign a value of “John” to property owner.