State Board of Cricket Council - Requirement Document 5
State Board of Cricket Council - Requirement Document 5
State Board of Cricket Council - Requirement Document 5
The State Board of Cricket Council (SBCC) wants the system to upgrade an old functionality
with few features. Hence you being their software consultant have agreed to upgrade the existing
validation functionality of the system and to integrate this functionality into the existing system.
Validation Rules:
The playerId has to be validated based on all the following constraints using the validatePlayerId
method in the SBCCUtility class
AXCD6422D, JHDF9876J
If the playerId is valid then this method has to return true else this method has to throw a user defined
Exception “InvalidPlayerIdException” with a message "Player with Id <<playerId>> is not valid".
In the UserInterface class, in the main method provided, fill the code to produce the output as
shown in the Sample input and Output.
When the user selects option 1 i.e., Validate player details, it should get the player details from
the user, and invoke the method to parse the player details. If valid player is returned then display
the player details such as playerId, playerName, matchesPlayed, runScored and playingZone, else
display "Please provide a valid record".
When the user selects option 2 i.e., Create Batsman or Bowler, it should get the player details
from the user and invoke the method to parse the player details. If valid player is returned then
display the player details based on the player type (Batsman or Bowler), else display "Please
provide a valid record" along with the exception message "Player with Id <<playerId>> is not
valid" if invalid player details found.
When the user selects option 3 i.e., Validation with InvalidPlayerIdException, it should get the
player details from the user, and invoke the method to parse the player details. If valid player is
returned then display the player details based on the player type (Batsman or Bowler), else
display "Please provide a valid record" along with the exception message "Player with Id
<<playerId>> is not valid" if invalid player details found.
When the user selects option 4 i.e., Exit, display the message "Thank you for using SBCC
application" and end the program.
Sample Input and Output 1 [Values given in bold represents the input]:
4. Exit
HB1234D:Dhoni:5:120:50:55:198:100:North:Batsman:3:2
// Note: Display the message << Please provide a valid record>> if the parsePlayerDetails method returns null
4. Exit
SAFG1243P:Mahee:3:20:30:55:South:Bowler:4:0
Number of Maidens: 4
Number of Hattricks; 0
4. Exit
HXCB1234D:Dhoni:5:20:130:55:102:100:North:Batsman:3:1
4. Exit
HXC234D:Dhoni:5:20:130:55:102:100:North:Batsman:3:1
// Note: Display the message << Please provide a valid record>> if the parsePlayerDetails method returns null
3. Exit
HXCB1234D:Dhoni:5:50:130:55:102:100:North:Batsman:3:2
Number of Fifties: 2
4. Exit
SAFG1243P:Mahee:3:20:30:55:South:Bowler:4:0
Number of Maidens: 4
Number of Hattricks: 0
4. Exit
2
Enter the player details
HXC234D:Dhoni:5:20:130:55:102:100:North:Batsman:3:1
// Note: Display the message << Please provide a valid record>> if the parsePlayerDetails method returns null
4. Exit