Question: int search ( const college a [ 1 , unsigned n , string name, string category ) ; This function takes four parameters: The first
int searchconst college a unsigned string name, string category;
This function takes four parameters:
The first is an array of College objects.
The second is the number of array elements to be searched.
The third is to identify the College name of interest.
The fourth is to identify the data of interest.
The function is to search the first elements of the College array and return the related data in the given College under the given category. If no match is found, the function shall return a negative value.
The focus of the function is to retum a value. While you might find it helpful to add output statements in the function to help see intermediate values of local variables, the function shall not include any output statements when you are ready to capture screenshots of the testing for this function. To demonstrate testing of this function, you will need to make several calls to the search function and display respective results in the main function. Here is a sample testing code segment:
cout "InThe acceptance rate of University of California Los Angeles is ;
cout searchtist "University of Callfornta Los Angeles", "rate"&;
For the function call to the search function in the above code segment:
The first argument is an array of College objects with the initial data.
The second argument is the number of colleges in the array.
The third argument indicates "University of California Los Angeles" is the College of interest.
The fourth argument indicates "rate" or exchangerate is the data of interest.
The output generated by the above test code is provided below:
The acceptance rate of University of California Los Angeles is
void sortbyname College a unsigned ;
void sortbycostCollege unsigned ;
void sortbyliving College a unsigned ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
