11# Instructions
22
3- You are developing a system to help the staff of a football/soccer club's web site report on matches.
3+ You are developing a system to help the staff of a football/soccer club's web site report on matches.
44This system is capable of analyzing different aspects in the match, both on and off the field, and converts them into a stream of events.
55
66## 1. Output descriptions of the players based on their shirt number
@@ -9,7 +9,7 @@ The team only ever plays a 4-3-3 formation and has never agreed with the 1965 ch
99
1010The player descriptions are as follows:
1111
12- ```
12+ ``` text
13131 -> "goalie"
14142 -> "left back"
15153 & 4 -> "center back"
@@ -27,9 +27,9 @@ PlayAnalyzer.AnalyzeOnField(10);
2727// => "striker"
2828```
2929
30- ## 2. Raise an alert if an unknown shirt number is encountered
30+ ## 2. Handle unknown shirt numbers
3131
32- Modify the ` PlayAnalyzer.AnalyzeOnField() ` method to throw an ` ArgumentOutOfRangeException ` when a shirt number outside the range 1-11 is processed.
32+ Modify the ` PlayAnalyzer.AnalyzeOnField() ` method to report ` UNKNOWN ` when a shirt number outside the range 1-11 is processed.
3333
3434## 3. Extend the coverage to include off field activity
3535
@@ -41,7 +41,7 @@ To start off, we will cover data about the stadium:
4141- The current number of supporters in the stadium (any ` int ` )
4242- Announcements made over the stadium's PA system (any ` string ` )
4343
44- Unknown types of data should not be processed, so if the method receives data of a different type an ` ArgumentException ` should be thrown .
44+ Unknown types of data should not be processed, so if the method receives data of a different type an empty string should be returned .
4545
4646``` csharp
4747PlayAnalyzer .AnalyzeOffField (5000 );
@@ -51,15 +51,15 @@ PlayAnalyzer.AnalyzeOffField("5 minutes to go!");
5151// => "5 minutes to go!"
5252
5353PlayAnalyzer .AnalyzeOffField (0 . 5 );
54- // => throws ArgumentException
54+ // => ""
5555```
5656
5757## 4. Report on incidents during the match
5858
59- Modify the ` PlayAnalyzer.AnalyzeOffField() ` method to output descriptions of incidents that happen during the match.
59+ Modify the ` PlayAnalyzer.AnalyzeOffField() ` method to output descriptions of incidents that happen during the match.
6060
61- Incidents can be any subclass of the ` Incident ` type, and will contain a description of the incident.
62- Injuries are a special kind of incident because they cause the match to be put on hold, so they should be treated differently.
61+ Incidents can be any subclass of the ` Incident ` type, and will contain a description of the incident.
62+ Injuries are a special kind of incident because they cause the match to be put on hold, so they should be treated differently.
6363
6464``` csharp
6565PlayAnalyzer .AnalyzeOffField (new Foul ());
@@ -73,8 +73,8 @@ PlayAnalyzer.AnalyzeOffField(new Injury(8));
7373
7474Modify the ` PlayAnalyzer.AnalyzeOffField() ` method to mention the club managers present during the match.
7575
76- Managers are instances of the ` Manager ` type and have a name and the name of the club they manage.
77- The manager's club may be unknown, in which case it will be set to ` null ` .
76+ Managers are instances of the ` Manager ` type and have a name and the name of the club they manage.
77+ The manager's club may be unknown, in which case it will be set to ` null ` .
7878If a manager's club is not known, it should not be part of the description.
7979
8080``` csharp
0 commit comments