Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 In this question you will be asked to complete basic statistics on a specified array of integer values. A good reference for basic
Question 1 In this question you will be asked to complete basic statistics on a specified array of integer values. A good reference for basic statistics formulas can be found at: http://integral-table.com/downloads/stats.pdf. a. In the class file H4_Q1, create an int array named numbers initialized with the following values: {2, 6, 9, 3, 12, 4, 14,4}. b. Add code to H4_Q1 that determines the sample mean of numbers and prints it to the screen with an appropriate label. c. Using the algorithm given below, write code in H4_Q1 to sort the array numbers in ascending order. Let n be the size of numbers. Use your code to sort array numbers and print the resulting array with an appropriate label. input: output: 1. 2. 3. 4. 5. 6. 7. a non-sorted list of n numbers, 21, 22 ..., An a list with the same numbers, sorted in non-decreasing order for i: n to 1 for j: 1 to i - 1 if a; > aj+1 then { // swap a; with aj+1 traj ajaj+1 2j+1+t } Figure 1: Sorting Algorithm d. In H4_Q1, write code to identify the median of the data in numbers Note that your code should work when the dataset contains an even or odd number of records. Write the result to the screen with an appropriate label
Step 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