07
acting on choices

challenge

  1. write a function that prints yes or no to the output window based on the result of Math.random—[0, .5) = "yes", [.5, 1) = "no".
  2. write a function that picks a random number [0,4] and uses a switch statement or several if..else statements to print the following to the output window:
    • for 0 print "choiceA"
    • for 1 print "choiceB"
    • for 2 print "choiceC"
    • for 3 print "choiceD"
    • for 4 print "choiceE"
    e.g.:
    function makeAChoice():String {
    	// your code here
    }