TLP - Programming Maintenance
Week 1 - Revisiting the FOP Final

Background

To avoid mistakes, please read the following carefully.

 

 

Task One

The problem with comparing athletes in a sport like basketball is that different players play different amounts of time. It is one thing to ask which is better: But what if we were looking at an entire career: One way that statisticians account for this (and there are several ways) is to understand that an NBA game is 48 minutes long.  Given this, the statisticians adjust the number of points scored into units of 48 minutes to consider how many points a player could have scored in an "entire game."

 

Create a function called: pointsPer48()
This function should:

 

 

Task Two

Let's consider how many points the "average" NBA player scores in their career.

 

Create a function called: averagePoints()
This function should:

 

 

Task Three

In Task One I asked you to calculate, for one player, their pointsPer48 statistics. Let's use that function to add another column to our data files.

Create a function called: addColumn()
This function should:

 

 

Task Four

In Task Three I asked you to add some data to our file. But it added data for every player in our file. Suppose I want to focus in on the players who played the equivalent of a full NBA season (82 games). In this last function, I encourage you to copy and paste your code from addColumn() but rename it to be addAndClean(). Then modify the code so that it only writes out the information for players with 82 or more games to the final output file.

Create a function called: addAndClean()
This function should: