Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
You have a list of runners and their race times and ages. Write a
Program to display the runners sorted by finish time with a column showing
their finish position (ranking) within their age group.

The age groups are
0 - 15 years
16 - 29 years
30+ years

Name Time Age
--------------------
Steve 12 33
Tim 34 28
Mark 22 37
Tom 21 30
Cliff 13 33
Vini 17 28
Matt 10 28
Ben 9 29
Brandon 15 14


Output should be like below

Name Time Age Ranking
===== ==== === =======
Ben 9 29 1
Matt 10 28 2
Steve 12 33 1
Cliff 13 33 2
Brandon 15 14 1
Vini 17 28 3
Tom 21 30 3
Mark 22 37 4
Tim 34 28 4
Posted
Updated 8-Sep-11 23:38pm
v2
Comments
Raju Katare 11-Sep-11 10:12am    
I have tried but could not get solution. That is why I did post my question here.
Raju Katare 19-Sep-11 2:32am    
Finally I could solve it.

 
Share this answer
 
Comments
Raju Katare 11-Sep-11 10:12am    
I have tried but could not get solution. That is why I did post my question here.
Raju Katare 19-Sep-11 2:32am    
Finally I could solve it.
You have to:
  1. Read the Quick Answers FAQ.
  2. if you still think we should do your homework, then go to point 1.
  3. Do your own homework.
 
Share this answer
 
Comments
Raju Katare 11-Sep-11 10:12am    
I have tried but could not get solution. That is why I did post my question here.
Raju Katare 19-Sep-11 2:32am    
Finally I could solve it.
CPallini 19-Sep-11 3:10am    
Congratulations.
Raju Katare 19-Sep-11 11:49am    
Thank You.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900