(C ONLY) The program expects the name of an input file and an output file to be given by the user. If the user does not input any names, default file names should be used, such as input.txt and...


(C ONLY) The program expects the name of an input<br>file and an output file to be given by the user. If the<br>user does not input any names, default file names<br>should be used, such as input.txt and output.txt.<br>The input files have lines which look like this: 3<br>Tester College; 1909 33001 The first number<br>represents the rank; it is followed by the school<br>name, year founded, and approximate number of<br>students. Read the list of colleges into an array of<br>structures. You may assume that the maximum size<br>of a college name string is 64. The program should<br>use either the insertion sort algorithm or the<br>selection sort algorithm to sort the array in<br>descending order by rank. Display any k consecutive<br>schools requested by the user. For instance, if the<br>user enters 12, the program displays the first 2<br>schools in a readable format of your choice. If the<br>user enters 15, the program displays the first five<br>schools, if the user enters 2 7, display 7 schools<br>beginning with the one at index 1 (2 - 1), and so on.<br>Repeat this process until the user enters 0 0. Reject<br>invalid input (such as -1 5, or 1 200, etc.) Finally<br>write the sorted array to the output file, using the<br>same format as in the input file's format. Run the<br>program once and save the screen output at the end<br>of the source file as a comment. input.txt 3 Tester<br>College; 1929 33001 5 Aponoeo College; 1964<br>22300 9 Arizona College; 1942 4000 7 Westside<br>College; 1972 9506 2 Apollo College; 1917 25300 8<br>Sidester College; 1947 4760 4 Diablo Valley College;<br>1939 24781 6 Foothill College; 1947 18362 1 College<br>of the Herch; 1957 24712 10 Quelsa College; 1953<br>19571<br>

Extracted text: (C ONLY) The program expects the name of an input file and an output file to be given by the user. If the user does not input any names, default file names should be used, such as input.txt and output.txt. The input files have lines which look like this: 3 Tester College; 1909 33001 The first number represents the rank; it is followed by the school name, year founded, and approximate number of students. Read the list of colleges into an array of structures. You may assume that the maximum size of a college name string is 64. The program should use either the insertion sort algorithm or the selection sort algorithm to sort the array in descending order by rank. Display any k consecutive schools requested by the user. For instance, if the user enters 12, the program displays the first 2 schools in a readable format of your choice. If the user enters 15, the program displays the first five schools, if the user enters 2 7, display 7 schools beginning with the one at index 1 (2 - 1), and so on. Repeat this process until the user enters 0 0. Reject invalid input (such as -1 5, or 1 200, etc.) Finally write the sorted array to the output file, using the same format as in the input file's format. Run the program once and save the screen output at the end of the source file as a comment. input.txt 3 Tester College; 1929 33001 5 Aponoeo College; 1964 22300 9 Arizona College; 1942 4000 7 Westside College; 1972 9506 2 Apollo College; 1917 25300 8 Sidester College; 1947 4760 4 Diablo Valley College; 1939 24781 6 Foothill College; 1947 18362 1 College of the Herch; 1957 24712 10 Quelsa College; 1953 19571
Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here