solution

Studentsare required to submit assignment 4 to your instructor for grading.The assignments are on the assigned materials/textbook topics associated with the course modules. Pleaseread the following instruction and complete it to post on schedule.

Write a program that dynamically allocates an array (pointer-based array) large enough to hold a user-defined number of test scores. Once all the scores are entered, then display the input data. Then the array should be passed to a function that sort based on QuickSort them ascending order and display the ascending order. Other functions should be called that calculate the average score.Other functions should be called calculate the average score. Finally, insert add function to input more data into the array, and then display all input data. Also, call theQuickSort function to display the new ascending order and the new descending order.

Again the program should display the original list and the sorted list of scores and averages with an appropriate heading. You MUST input at least ten more data, use a pointer notation rather than array notation, and also MUST use the pointer notationfor QuickSort.

Sample output:

How many numbers will you enter? 11 [Enter]

Enter 11 numbers:

3 5 16 12 1 4 7 9 10 200 100 [Enter]

Display Input Data: 3 5 16 12 1 4 7 9 10 200 100 [Enter]

Ascending Order: 1 3 4 5 7 9 10 12 16 100 200 [Enter]

Descending Order: 200 100 16 12 10 9 7 5 4 3 1 [Enter]

Average: 33.36 [Enter]

How many more numbers will you enter? 3 [Enter]

Enter 3 numbers:

200 4000 6 [Enter]

Display Input Data: 3 5 16 12 1 4 7 9 10 100 200 200 4000 6 [Enter]

Ascending Order: 1 3 4 5 6 7 9 10 12 16 100 200 200 4000 [Enter]

Descending Order: 4000 200 200 100 16 12 10 9 7 6 5 4 3 1 [Enter]

Average: 326.64 [Exit]

For example, QuickSort is a sorting algorithm, which is commonly used in computer science. QuickSort is a divide and conquers algorithm. It usually uses recursion in quicksort implementation. In each recursive call, a pivot is chosen, then the array is partitioned in such a way that all the elements less than pivot lie to the left and all the elements greater than pivot lie to the right.That is a typical divide and conquer algorithm and it just follows the intuitive approach of speeding up the sorting process by reducing the number of comparisons. Such an algorithm is quicksort.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp