Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Cricket board wants to maintain the cricketer's profile and finds the top three batsmen based on their striking rate and also finds top three bowlers
Cricket board wants to maintain the cricketer's profile and finds the top three batsmen based on their striking rate and also finds top three bowlers based on wickets taken so far. For these purpose create a class called "Person" which has three data members "Name" of string datatype. "matchcount" of int type to mention a number of matches played by the player, "id" of int type is used to identify the player uniquely. Create subclass called "Batsman" which is derived from "Person" which includes data member "Total_Runs" of int type to mention a total number of runs so far scored, another data member "striking rate of int type and it is calculated by dividing Total_Runs by match count. Create another subclass "Bowler" which is derived from "person" and includes data member "wicket_count" of int type. Create a GUI with the following Swing components. 1. Two Radio button with caption "Batsman" and "Bowler." 2. Four text field to receive name, id, match count, total runs(if batsman)/wicket count(if bowler) 3.One text area to display the player details 4. Three buttons with caption "Add","search", "Top3player" To get the batsman details, first press the "Batsman" radio button next enter the details in the corresponding text field, then add the details in the Arraylist! by pressing "Add" button. To get the bowler details, first press the "Bowler" radio button,next enter the details in the corresponding text field then add the details in the Arraylist2 by pressing "Add" button. Check that all required fields are filled or not before pressing the "Add" button. If it is not properly filled out, throw the user-defined Exception and show it in text area. When we press the "search" button, Search the player details based on the id. When we press the button "Top3player" displays the top three batsman details based on striking rate and top three bowler details based on wicket count
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