Answered step by step
Verified Expert Solution
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
In 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 observationStep 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