Dr. A.P.J. Abdul Kalam Technical University (AKTU), Lucknow
Lab Exercise
36. Define a structure called cricket with player name, team name, batting average, for 55 players & 5 teams. Print team-wise list contains names of players with their batting average.
Sample Input and Output
Stdin Inputs:
India
Virat Kohli
59.07 Rohit Sharma
48.96 Hardik Pandya
34.24 Ravichandran Ashwin
30.80 Ravindra Jadeja
36.20 Cheteshwar Pujara
46.60 Ajinkya Rahane
41.30 Shikhar Dhawan
45.28 KL Rahul
48.67 Mohammad Shami
9.80 Ishant Sharma
8.63 Australia
PJ Cummins
16.46 C Green
33.71 MS Harris
23.77 JR Hazlewood
12.02 M Labuschagne
60.80 NM Lyon
12.23 TD Paine
32.63 SPD Smith
61.80 MA Starc
22.16 MS Wade
29.87 DA Warner
48.09
… Input other three teams details as above …
Sample Result:
Input Team Name: India
Input 1 player details
Name: Virat Kohli
Batting Average: 59.07
Input 2 player details
Name: Rohit Sharma
Batting Average: 48.96
Input 3 player details
Name: Hardik Pandya
Batting Average: 34.24
Input 4 player details
Name: Ravichandran Ashwin
Batting Average: 30.80
Input 5 player details
Name: Ravindra Jadeja
Batting Average: 36.20
Input 6 player details
Name: Cheteshwar Pujara
Batting Average: 46.60
Input 7 player details
Name: Ajinkya Rahane
Batting Average: 41.30
Input 8 player details
Name: Shikhar Dhawan
Batting Average: 45.28
Input 9 player details
Name: KL Rahul
Batting Average: 48.67
Input 10 player details
Name: Mohammad Shami
Batting Average: 9.80
Input 11 player details
Name: Ishant Sharma
Batting Average: 8.63
Input Team Name: Australia
Input 1 player details
Name: PJ Cummins
Batting Average: 16.46
Input 2 player details
Name: C Green
Batting Average: 33.71
Input 3 player details
Name: MS Harris
Batting Average: 23.77
Input 4 player details
Name: JR Hazlewood
Batting Average: 12.02
Input 5 player details
Name: M Labuschagne
Batting Average: 60.80
Input 6 player details
Name: NM Lyon
Batting Average: 12.23
Input 7 player details
Name: TD Paine
Batting Average: 32.63
Input 8 player details
Name: SPD Smith
Batting Average: 61.80
Input 9 player details
Name: MA Starc
Batting Average: 22.16
Input 10 player details
Name: MS Wade
Batting Average: 29.87
Input 11 player details
Name: DA Warner
Batting Average: 48.09
… Input other three teams details as above …
Teams
Team 1: India
Sr. Player Name Batting Average
1. Virat Kohli 59.07
2. Rohit Sharma 48.96
3. Hardik Pandya 34.24
4. Ravichandran Ashwin 30.80
5. Ravindra Jadeja 36.20
6. Cheteshwar Pujara 46.60
7. Ajinkya Rahane 41.30
8. Shikhar Dhawan 45.28
9. KL Rahul 48.67
10. Mohammad Shami 9.80
11. Ishant Sharma 8.63
Team 2: Australia
Sr. Player Name Batting Average
1. PJ Cummins 16.46
2. C Green 33.71
3. MS Harris 23.77
4. JR Hazlewood 12.02
5. M Labuschagne 60.80
6. NM Lyon 12.23
7. TD Paine 32.63
8. SPD Smith 61.80
9. MA Starc 22.16
10. MS Wade 29.87
11. DA Warner 48.09
… Other three teams details as above …