Question: Ask the user to insert how many array elements that they desired, maximum 2 0 . 2 . Create three arrays ( array 1 ,

Ask the user to insert how many array elements that they desired, maximum 20.
2. Create three arrays (array1, array2, array3) with each of them have the total number of elements that inserted by user.
3. Generate a random number for each element in the first two arrays (array1 & array2) within the range of 0 to 10,000.
Hints: You could explore srand() and rand() to generate the random number.
4. For the first two arrays (array1 & array2), compare element by element. If the element value of array1 is larger than array2, then store 1 in the array3 element accordingly. If the element value of array1 is smaller than array2, then store 2 in the array3 element accordingly. If the element of array1 and array2 are equal, then store 0 in the array3.
5. From array3 which only stores 1,2 or 0 based on the comparison result of each element stores in the array1 and array2, determine:
The total number of elements that array1 is larger than array2.
The total number of elements that array2 is larger than array1.
The total number of elements that array1 is equal with array2.
6. Perform the following computations:
Identify the highest value (max) of array1.
Identify the lowest value (min) of array2.
Calculate the average value (mean) of array1.
Sort the array2 in ascending order and determine the median value.
Hints: You need to explore several sorting algorithms from Internet, e.g. Bubble sorting, insertion sorting, selection sorting, etc.
Snapshot in the next page shows the program execution output example for your reference, you are free to design your own more interactive user interface or additional function, such as:
Let the user decide if the array sorting prefer in ascending order or descending order.
Make the program more user friendly by asking the user if they want to repeat the whole process before exit the program.
For assignment submission, you need to submit/upload 3 files to the e-learning:
1..pdf: Flowchart of your program solutions.
2..c: Source code of your program or OneCompiler link.
3..png/.jpg/: Snapshot of your execution output (only applicable to Codeblock).

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!