Question
C program: We have 6 arrays: sportsmen and their results at three competitions. If a competitor fails the competition then their name will be missing
C program:
We have 6 arrays: sportsmen and their results at three competitions. If a competitor fails the competition then their name will be missing from the results.
Write a program in C( please add comments) that displays the names of all competitors, top three of those that got points at all three competitions and competitors that failed at least one competition.
Implement at least these functions:
- Reading the arrays (this function should be called three times, once for each competition).
- Displaying the names of competitors.
- Sorting competitors based on scores.
- Displaying the top three.
- Displaying the failed competitors.
Example txt file:
4 Juku 49.8 Meelis 51.0 Peeter 47.5 Ats 47.7 Paul 49.2 Anti 50.5 Peep 49.5 5 Meelis 35.2 Juku 33.7 Peeter 32.9 Paul 31.0 Ats 37.1 Teet 36.5 Peep 37.1 Anti 33.3 5 Juku 56.6 Peeter 59.2 Teet 53.3 Ats 51.0 Paul 49.9 Mart 57.1 Meelis 55.4 Anti 54.2
Example: 4 Juku 49.8 Meelis 51.0 Peep 49.5 Ats 47.7 4 Meelis 35.2 Juku 33.7 Peeter 32.9 Ats 37.1 5 Juku 56.6 Peeter 59.2 Teet 53.3 Antti 54.2 Meelis 55.4 Result: Participants: Juku, Meelis, Peep, Ats, Peeter, Teet, Antti Top three: 1. place: Meelis with 141.6 points 2. place: Juku with 140.1 points 3. place: Failed: Peep, Ats, Peeter, Teet, Antti
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started