Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In basic C++ - Write a function named fillArrayRandomly that takes an integer array, its size, and an integer x representing the max value for

image text in transcribedIn basic C++

- Write a function named "fillArrayRandomly" that takes an integer array, its size, and an integer x representing the max value for the range between 1 and x. The function generates array size times random integers between the given interval. For generating random numbers, use the random library and std::uniform int distribution function. Each random number is assigned to the array element. The function returns nothing but changes the array items. (5p) - Write another function named "printFrequency" that takes a constant integer array and its size and max interval value, then prints the occurrence of each unique array item. (5p). - Write the main function that calls two functions appropriately for (5p) 1. the 1000-length integer array for initializing the random numbers between 1 and 10 (max) and prints the frequency of each number. 2. the 10000 -length integer array for initializing the random numbers between 1 and 10 (max) and prints the frequency of each number. - Do two histogram results represent the uniform distribution? Run the program at least three times and write your observation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

Students also viewed these Databases questions