Question: C Program NOT C++ Write a program that provides information about two-year colleges in California. The program expects the name of an input file and
C Program NOT C++
Write a program that provides information about two-year colleges in California. 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 in.txt and out.txt. The input files have lines which look like this:
3 Santa Barbara City College; 1909 30687
The first number represents the rank; it is followed by the school name, year founded, and approximate number of students.
The input data file contains the schools sorted in ascending order by year founded. Read the list of colleges into an array of structures. You may assume that the maximum size of a college name string is 64.
Display Data Manager: Print any k consecutive schools requested by the user. For instance, if the user enters 0 2 you will display the first 2 schools in a readable format of your choice. If the user enters 0 5 display the first five schools, if the user enters 2 7 display 7 schools beginning with the one at index 2, and so on. Repeat this process until the user enters 0 0.
The program should use either the insertion sort algorithm or the selection sort algorithm to sort the array in descending order by rank. Finally write the sorted array to the output file, using the same format as in the input files format. Use the given input file or create your own input file using the data shown below.
in.txt
3 Santa Barbara City College; 1909 30687
5 Pasadena City College; 1924 22000
14 West Hills College Coalinga; 1932 4000
7 Napa Valley College; 1942 8996
2 Orange Coast College; 1947 25000
15 Palo Verde College; 1947 3898
4 Diablo Valley College; 1949 24781
6 Foothill College; 1957 18362
12 College of the Siskiyous; 1957 2473
10 Cuesta College; 1963 9571
8 Ohlone College; 1965 18000
1 De Anza College; 1967 24781
11 Feather River Community College District; 1968 1635
13 Lake Tahoe Community College; 1975 3000
9 Irvine Valley College; 1985 14384
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
