cre 3 is the 4th clement in the array and 0 is value of that element. Now assign ach element. You can use the function rand() which will return an integer. T ma number between 0 and RAND_MAX = 32767. You can mod the value r dộ by 16 to fit the range 0 to 15. For debugging, the seed is the same until yo s means all the output numbers will be the same as in the sample output. eckpoint 2: We want to calculate some base statistics for the array. You can nent of the array by using "my array[i]" where i is the index of the array. Yo p to run through each index to cover the entire array. We will start finding sta y by finding the maximum value, minimum value, and sum of all values in th eckpoint 3: Using the data from the previous checkpoint, find the range (high Irange (halfway between the maximum and minimum), and the mean of the an to 3 to make sure you are getting float values when needed for mean and mid

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question
Checkpoint 1: Create an array and initialize all the elements to 0. Write a loop that will display
cach elements position and value. That is show "my_arrayf3] = 0" for each element as output
where 3 is the 4th clement in the array and 0 is value of that element. Now assign random values
to cach element. You can use the function rand() which will return an integer. This function will
return a number between 0 and RAND MAX = 32767. You can mod the value retumed by
rand() by 16 to fit the range 0 to 15. For debugging, the seed is the same until you change it.
This means all the output numbers will be the same as in the sample output.
Checkpoint 2: We want to calculate some base statistics for the array. You can access each
element of the array by using "my array[i]" where i is the index of the array. You may use a
loop to run through each index to cover the entire array. We will start finding statistics for this
array by finding the maximum value, minimum value, and sum of all values in the array.
Checkpoint 3: Using the data from the previous checkpoint, find the range (highest- lowest),
midrange (halfway between the maximum and minimum), and the mean of the aray. Set your
size to 3 to make sure you are getting float values when needed for mean and midrange. You can
cast an integer to a float using either of the following methods.
mean = (float) sum / SIZE;
midrange = static_cast<float> (max + min) / 2;
Checkpoint 4: Find the standard deviation of the array. s =
n-1
Checkpoint 5: Find the mode by using a separate bucket array to track how many times each
value appears.
Checkpoint 6: Before calculating the median, we must manipulate the array. You want to use
the Bubble Sort Algorithm to sort the numbers in ascending order.
Checkpoint 7: Use the sorted array to calculate the median.
Note: The values are pseudorandom. The values shown in the example output are the values
with the default seed in C++. To randomize, seed the RNG based on the time. Include <ctime>
and use the command below in main before using rand().
srand( time( e ) );
Transcribed Image Text:Checkpoint 1: Create an array and initialize all the elements to 0. Write a loop that will display cach elements position and value. That is show "my_arrayf3] = 0" for each element as output where 3 is the 4th clement in the array and 0 is value of that element. Now assign random values to cach element. You can use the function rand() which will return an integer. This function will return a number between 0 and RAND MAX = 32767. You can mod the value retumed by rand() by 16 to fit the range 0 to 15. For debugging, the seed is the same until you change it. This means all the output numbers will be the same as in the sample output. Checkpoint 2: We want to calculate some base statistics for the array. You can access each element of the array by using "my array[i]" where i is the index of the array. You may use a loop to run through each index to cover the entire array. We will start finding statistics for this array by finding the maximum value, minimum value, and sum of all values in the array. Checkpoint 3: Using the data from the previous checkpoint, find the range (highest- lowest), midrange (halfway between the maximum and minimum), and the mean of the aray. Set your size to 3 to make sure you are getting float values when needed for mean and midrange. You can cast an integer to a float using either of the following methods. mean = (float) sum / SIZE; midrange = static_cast<float> (max + min) / 2; Checkpoint 4: Find the standard deviation of the array. s = n-1 Checkpoint 5: Find the mode by using a separate bucket array to track how many times each value appears. Checkpoint 6: Before calculating the median, we must manipulate the array. You want to use the Bubble Sort Algorithm to sort the numbers in ascending order. Checkpoint 7: Use the sorted array to calculate the median. Note: The values are pseudorandom. The values shown in the example output are the values with the default seed in C++. To randomize, seed the RNG based on the time. Include <ctime> and use the command below in main before using rand(). srand( time( e ) );
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning