Workbook 10.1
From the Java Bootcamp Resources
, launch starter
.
Task 1
The details()
method contains many loose integers.
"\nCourt length (feet): " + 94 + "\nRim height (feet): " + 10 + "\nDistance from three-point arc: " + 23 + "\nPoints awarded beyond the three-point arc: " + 3 + "\nPoints awarded inside the three-point arc: " + 2 + "\nPoints awarded from a free throw: " + 1 + "\nLength of each quarter (minutes): " + 12 + "\nSeconds to attempt shot after gaining possession: " + 24;
Create eight constants inside Regulation
and use them inside the Game
class.
public class Regulation {
COURT_LENGTH
RIM_HEIGHT
THREE_POINT_DISTANCE
BEYOND_THREE_POINT_ARC
INSIDE_THREE_POINT_ARC
FREE_THROW
QUARTER_LENGTH
POSSESSION_TIME
}
Associated Course: The Complete Java Development Bootcamp
Related Course: The Complete Spring Boot Development Bootcamp – Become a Java Web Developer
Feedback Summary
4.7
43 students
5
91%
4
2%
3
0%
2
0%
1
7%
Written Reviews
There are no written reviews yet.