Question: The Coding Language is C Compiler. Bubble Sort Assignment Using Command Line Write a program that will allow the user to generate as many random

The Coding Language is C Compiler.
Bubble Sort Assignment Using Command Line Write a program that will allow the user to generate as many random numbers as they wish (up to 10,000), sort them into ascending order, and print the sorted numbers. You must use an array to store the numbers, and subroutines to generate and sort the numbers. You MUST make sure that the user selects at least 2 numbers but not more than 10,000. Quantity of numbers user wishes to sort may come from command line and if not, the user should be prompted. Sorted output MUST be on one line separated by a single space. Pseudocode for Main: If user enters the quantity of numbers to generate and sort on command line Convert and assign that number to the appropriate variable Otherwise Ask the user how many numbers they wish to generate and sort Read the input into the appropriate variable While the user's input for the quantity of numbers is less than 2 or greater than 10,000 Display an error message Ask how many numbers they wish to generate and sort Read the input Use a for loop to load specified quantity of random numbers into the array Invoke the bubble sorter (Pass the array and number of items in it) Use a for loop to print the sorted array from first item to last. Test you program using: 10 numbers from command line 15 numbers requested at program prompt NOTE: Modify your program to sort into descending order 5 numbers . Try to sort 10,001 numbers from command line, 10,002 numbers, 0 numbers, 1 number, and then an acceptable amount. Information concerning subroutines used: (discussed in class) Prototypes: int randu(void) void bubble(int int): void swap(int int) Definitions: int randu(void) static int seed=17; seed (25179* seed-13849665536 retum seed void bubble in all, int n) { intis for (i = 0; i swap(&ali-11&alil). void swap int *a, int *b) int temp. temp = a: " = tmp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
