title: "exam2" output: htmlnotebook ---

Question 5

Consider the following vectors representing the number of field goals made and attempted by

{r} # Field goals made FGM <- c(18, 7, 6, 9, 10, 13)

{r} # Field goals attempted FGA <- c(36, 23, 12, 18, 24, 22)

Calculate the field goal percentage for each game and the average field goal

{r} # Calculate FG% for each game FG_Percentage <- (FGM / FGA) * 100 round(FG_Percentage, 2)

{r} # Calculate average FG% Average_FG <- mean(FG_Percentage) round(Average_FG, 2)