package { import flash.display.*; import flash.events.*; public class Assign5 extends MovieClip { // Constructor function public function Assign5( ) { // TASK 1: Create a custom rollVal property for the ship // and initialize it to 0 // TASK 2: Add a button event listener to allow the user to start the trial } // Button handler function function runTrial( evt: MouseEvent ) { // TASK 1: Define the following variables and give them sample values: // - A variable for the total number of trials to be run, // for instance 100 or 1000 // - A varible for the user's specified roll value: 1,2,3,4,5, or 6 // - A variable used to count the total number of rolls // of the die for all of the trials (several rolls per trial), // initialized to 0 // TASK 3: Repeat Task 2 for each trial via a while loop // that contains the assignment to set die 1‘s rollVal to 0 and // the while loop created for Task 2 // TASK 2: Set die1's rollVal to 0. Then, with a while loop, roll the die // by calling rollDie() until the user's specified roll value is rolled // At each roll, add 1 to the count of the total number of rolls // and display the roll value with a trace statement // TASK 4: With trace statements, display the number or trials // and the total number of rolls (several per trial) // TASK 5: Calculate and display the average number of rolls that // were required to obtain the specified roll value by // dividing the total number of rolls by the number of trials } // end runTrial function // Randomly generates an integer between 1 and 6 and // sets that to be the value of die1's roll value function rollDie( ) { } // end rollDie function } // end class } // end package