Question: d ) Have the script find the minimum and maximum of each dataset and display it to the screen, without using the min, max, or

d) Have the script find the minimum and maximum of each dataset and display it to the screen, without using the "min", "max", or "sort" commands. You should do this using loops (Hint: create a variable that will store the min, give it an initial value, then compare that value to all the values in the dataset). When displaying the result to the screen, display something like "The min life expectancy for Country A is _ and for Country B is _." and "The max life expectancy for Country A is _ and for Country B is _."
e) Sort each dataset into a new variable. Then, have the script find the median of each dataset and display it to the screen. Do not use the "median" command, instead have the program find the median from the sorted array. Make sure the script can find the median for a dataset with either an odd or even number of data points. When displaying the result to the screen, display something like "The median life expectancy for Country A is _ and for Country B is _."
f) Have the script find the variance of each dataset and display it to the screen, but do not use the "var" command, instead program the equation shown below using a loop. When displaying the result to the screen, display something like "The variance for Country A is and for Country B is _."
Variance =i=1n(xi-(x))2n-1
 d) Have the script find the minimum and maximum of each

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!