Question: I need help with this c++ task Problem Statement: We want to create a program that will store random integers between O and 99 in

I need help with this c++ task

I need help with this c++ task Problem Statement: We want tocreate a program that will store random integers between O and 99in a two-dimensional array. The program should find, and display sum ofall elements stored in the array. Solution: Use : rand() function for

Problem Statement: We want to create a program that will store random integers between O and 99 in a two-dimensional array. The program should find, and display sum of all elements stored in the array. Solution: Use : rand() function for generating random numbers. What is rand()? rand() function is an inbuilt function in C++ STL, which is defined in header file. rand() is used to generate a series of random numbers. We use this function when we want to generate a random number in our code. Like we are making a game of ludo in C++ and we have to generate any random number between 1 and 6 so we can use rand() to generate a random number The random number is generated by using an algorithm that gives a series of non-related numbers whenever this function is called. Like we want to generate a random number between 1-6 then we use this function like - Num = rand() % 6+1; Syntax int rand(); Parameters The function accepts no parameter(s) - Return value This function returns an integer value between 0 to RAND_MAX. Create a project with the name "ArrayProject" Inside this project, create a main class with the name "SumElements and add the following code in this class Output sample: Enter number of rows: 3 Enter number of colums: 3 Generating randowm numbers in matrix of 3 rows and 3 colums: Matrix [0,0]= 3 Matrix [0,1]= 6 Matrix [0,2]= 7 Matrix [1,0]= 5 Matrix [1,1]= 3 Matrix [1,2]= 5 Matrix [2,0]= 6 Matrix [2,1)= 2 Matrix [2,2)= 9 The sum of all elements of the above array is 46 | LAB EXERCISE: 1. Create a new project with the name Lab1_Arrays. Inside this project, create a file with the name ArrayExercises. II. In ArrayExercises file create the following methods: 1) fillArray_1D(array, size) method, to initialize the 1D array with random values (between 0 and 99) void fillArray_1D(int array(), int size}{ for(int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!