Define a class CricketPlayer (name, noofinnings, notimesnotout, totalruns, batavg). Create an array of n player objects. Calculate the. Join over 7 million developers in solving code challenges on HackerRank, one of the best ways to prepare for programming interviews. We use cookies to ensure you have the best browsing experience on our website.
Write a java program for a cricket player The program should accept the details fromuser (max 10): Player code, name, runs, innings- played and number of times not out. The
program should contain following menu:
-Enter details of players.
-Display average runs of a single player.
-Display average runs of all players. (Use array of objects & function overloading)
OUTPUT :
Enter No.of Players:
1
Enter Player Code:
1
Enter Player Name:
s
Enter Total Runs:
1000
Enter Times Not Out:
25
Enter Innings Played:
1000
Player Code For Avg Calculation
1
1 s 1000 25 1000 1.0
Average Of All The Players
1 s 1000 25 1000 1.0
1
Enter Player Code:
1
Enter Player Name:
s
Enter Total Runs:
1000
Enter Times Not Out:
25
Enter Innings Played:
1000
Player Code For Avg Calculation
1
1 s 1000 25 1000 1.0
Average Of All The Players
1 s 1000 25 1000 1.0
Developing Cricket Applications in JavaNext: Up: Previous:Developing Cricket Applications in JavaThe software package includes a library to help developers createCricket applications in Java. This chapter describes our softwarearchitecture and our Java Cricket client library API calledCricketlib.
At the end of the chapter, we show how to create asimple Cricket application in Java using Cricketlib. Werecommend developers to use this sample application as a template tocreate their own Cricket applications in Java.Michel Goraczko2004-12-02.