Question: struct mystruct { char a; int b; float c; }; struct mystruct myvar;In this assignment you are going to write a program which will compute
struct mystruct { char a; int b; float c; }; struct mystruct myvar;In this assignment you are going to write a program which will compute data for a Frisbee throwing contest. Each contestant received four opportunities to throw the Frisbee as far as they could. The contest data is stored in a text file named "frisbee_throw.txt" as follows. Distances are in feet.
Sheila Duffy 119.43 89.92 60.85 80.68
Tommy Pitts 124.87 28.92 136.21 96.08
Your program needs to read in the data, display the winner, and then display each contestants full name with the distance of their farthest throw (i.e., the largest of the four numbers following the persons name).
Program requirements:
Use a struct
Define your own contestant data struct consisting of three members:
A character array of length 30 named fName. This will store the first name of a contestant.
A character array of length 30 named lName. This will store the last name of a contestant.
A float named longestDistance. This will store the distance of their farthest row.
Arrays
Define and use an array of 50 elements of the above contestant data struct. You do not know how many players there will be, but imagine that you are expecting it to be much less than 50.
Input
Read in the data and fill values in the contest data array. Since you need only to store the longest distance for each contestant, the other three distance measurements are to be discarded. You will have to keep track of how many contestants there were. Assume that the data is perfectly formatted.
Output
Output the winner and individual best scores of each contestant using cout. This time there is no special requirements in formatting the output, but please make it clear and readable.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
