Question: 2. (a) You are given the following fiunction header: int bSearch(int key, int list), int to, int hi) /fsearch for key in list[lo, .ht] using

 2. (a) You are given the following fiunction header: int bSearch(int

2. (a) You are given the following fiunction header: int bSearch(int key, int list), int to, int hi) /fsearch for key in list[lo, .ht] using a binary search; /fif found, return its location; otheruise, return the locatton in //which key should be inserted so that list would renain sorted Write the function. (b) You are in charge of a men's high jump competition and you bave data on each competitor, stored in a file input txt. Each line of data consists of a jumper's number (integer), followed by his best 3 jumps (real numbers denoting height in metres). The number of jumpers is unknown but a line containing 8 only terminates the data. Here are some sample data 5555 1.42 1.46 1.53 4598 1.51 1.S6 1.49 3785 1.48 1.49 1.5e A jumper qualifies for the competition if the average of his 3 jumps is at least 1.50 metres. Withoud using any array, write a program to read the data and send the following to a file, output.txt. For each jumper, print his number, his average jump and whether or not he qualifies. Print the total number of jumpers and the number that qualify. Print the jumper with the highest average jump (ignore the possibility of a tic). 17) You are given the same data as in part (b) but it is known that there are no more than 80 jumpers. Write a program to read the data and send a report to the file output. txt consisting of jumper number and average jump in descending order by average jump (that is, best jumper first). You must store the jumper number and average jump in an appropriate array of struct. Show all declarations. (c) 18] Total Marks Q2: 20 CThe University of the West Indies Course Code COMP1602 201/2018 S1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!