Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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 ) ); ]
expand button
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
Check Mark
Knowledge Booster
Background pattern image
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
    Text book image
    Database System Concepts
    Computer Science
    ISBN:9780078022159
    Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
    Publisher:McGraw-Hill Education
    Text book image
    Starting Out with Python (4th Edition)
    Computer Science
    ISBN:9780134444321
    Author:Tony Gaddis
    Publisher:PEARSON
    Text book image
    Digital Fundamentals (11th Edition)
    Computer Science
    ISBN:9780132737968
    Author:Thomas L. Floyd
    Publisher:PEARSON
    Text book image
    C How to Program (8th Edition)
    Computer Science
    ISBN:9780133976892
    Author:Paul J. Deitel, Harvey Deitel
    Publisher:PEARSON
    Text book image
    Database Systems: Design, Implementation, & Manag...
    Computer Science
    ISBN:9781337627900
    Author:Carlos Coronel, Steven Morris
    Publisher:Cengage Learning
    Text book image
    Programmable Logic Controllers
    Computer Science
    ISBN:9780073373843
    Author:Frank D. Petruzella
    Publisher:McGraw-Hill Education