Status: Not Started
  • Scratchpad.java
  • Unit Test
Font Size
14
Parentheses autocomplete
Wrap lines
Editor
Theme
Code with blocks by default
Console Font Size
12
Console Theme
Display Server Graphics Screen
Show File Tab Bar
Debug Mode
Effective Field Goal Percentage
Unit Test
public double effectiveFieldGoalPercentage(int fgm2, int fgm3, int fga)
{
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output
Grading
Docs
Exercise
More
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Pass Test Message

Errors:


6 points

Write a method that computes the Effective Field Goal percentage (eFG%) for a player.

You should call it effectiveFieldGoalPercentage and it will take three integers:

fgm2 for 2-pt Field Goals Made
fgm3 for 3-pt Field Goals Made
fga for total Field Goals Attempted.

eFG% is computed by the number of 2-pt field goals made + 1.5 times the number of 3-pt field goals made, divided by the total number of field goals attempted.

This means that a 3-pt field goal is worth 1.5 times as much as a 2-pt field goal, so we weight it higher to represent the greater efficiency of shooting 3-pointers.

Reset Code

Slides and Notes

No slides available for this video

About

Java Practice (main)
Java Version 1.8.0_222

Upload Media