Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using excel VBA to create th program: 4) Randomness! We've heard a lot about it this semester, not to mention the seemingly random events we
Using excel VBA to create th program:
4) Randomness! We've heard a lot about it this semester, not to mention the seemingly random events we experience in our day-to-day lives such as the weather (and weather forecasts), squirrel sightings, and income taxes. Randomness plays a role in basic statistics in that a sample has a greater probability of representing a population when the samples are chosen at random from the population. This program will model the selection process. Create a dynamic array. Input the number of elements for this array from the worksheet. Populate the array with random numbers from a user defined range. This range is input from the "Highest value" and "Lowest value" cells in the worksheet. Output the index and value of each array element to the worksheet under the Raw Data heading. Pass the array to a Function. This Function will calculate the average of the values stored in the array, and return the average to the main procedure. Output the average to the worksheet under the Raw Data heading. No module variables are permitted for this problem. Create a second dynamic array to store the Sample data. Input the size of this array from the worksheet from the cell labelled Sample size in the figure. If the sample size is greater than the Raw data size (the number of elements in the Raw array) inform the user with a MessageBox. Populate the Sample array with randomly selected values from the Raw data array. An element can only be selected once from the Raw array Note in the figure that elements 6, 2 and 10 from the Raw array were randomly selected for the Sample array. Output the Sample array values with the corresponding index from the Raw data array under the Sample heading. Send the Sample array to the same function you created in part b) and have it return the average of the Sample array. Return the average to the main procedure. Output the average to the worksheet under the Sample headingStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started