Question: Many sports have constants embedded in their rules. For example, baseball has 9 innings, 3 outs per inning, 3 strikes in an out, and 4
Many sports have constants embedded in their rules. For example, baseball has 9 innings, 3 outs per inning, 3 strikes in an out, and 4 balls per walk. We might encode the constants for a program involving baseball as follows:
public static final int INNINGS = 9;
public static final int OUTS_PER_INNING = 3;
public static final int STRIKES_PER_OUT = 3;
public static final int BALLS_PER_WALK = 4;
For each of the following popular sports, give Java named constants that could be used in a program involving that sport:
Basketball
American football
Soccer
Cricket
Bowling
Step by Step Solution
3.48 Rating (158 Votes )
There are 3 Steps involved in it
These are just some of the possible constants we could define Basketball public s... View full answer
Get step-by-step solutions from verified subject matter experts
