reate all possible outcomes

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Create all possible outcomes

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
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY