- One person, fork this repo and add teammates as collaborators
- everyone clone that fork
- Set up the Spec Harness
- pay attention to the file structure in these setup instructions!
As a group:
- Make the existing tests pass.
- there are 3 failing tests
- do not change the tests
- Annotate the existing code in
stat_tracker
- comment above each line what that line is doing
- use technical jargon; ex: "The string "hello world" is being assigned to the variable
greeting
", "Iterate over the attribute@vehicles
which is an array of Vehicle objects, to find those that are Toyotas"
Complete the following methods. These should be instance methods on the StatTracker class. Be sure to test these, and other helper methods that you create!
- You could compolete these as a group, or split them up.
- You will need to update classes and tests that were provided.
- make sure to run the spec harness early and often! (not all of the tests in spec harness will be covered by the methods below).
Method | Description | Return Value |
---|---|---|
highest_total_score |
Highest sum of the winning and losing teams' scores | Integer |
lowest_total_score |
Lowest sum of the winning and losing teams' scores | Integer |
percentage_home_wins |
Percentage of games that a home team has won (rounded to the nearest 100th) | Float |
percentage_visitor_wins |
Percentage of games that a visitor has won (rounded to the nearest 100th) | Float |
percentage_ties |
Percentage of games that has resulted in a tie (rounded to the nearest 100th) | Float |
count_of_games_by_season |
A hash with season names (e.g. 20122013) as keys and counts of games as values | Hash |
Method | Description | Return Value |
---|---|---|
best_offense |
Name of the team with the highest average number of goals scored per game across all seasons. | String |
worst_offense |
Name of the team with the lowest average number of goals scored per game across all seasons. | String |
These methods each take a season id as an argument and return the values described below.
Method | Description | Return Value |
---|---|---|
most_accurate_team |
Name of the Team with the best ratio of shots to goals for the season | String |
most_tackles |
Name of the Team with the most tackles in the season | String |