From 530589328071875074b0b1bdb1883770ab6cafe4 Mon Sep 17 00:00:00 2001 From: manumafe98 Date: Thu, 1 Feb 2024 10:46:06 -0300 Subject: [PATCH 1/3] Creating design.md for football match reports As it was empty it was added the learning objectives, out of scope, concepts and prerequisites Also the analyzer was created --- .../football-match-reports/.meta/design.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/exercises/concept/football-match-reports/.meta/design.md b/exercises/concept/football-match-reports/.meta/design.md index 3d14cb7ce..3f54e6be8 100644 --- a/exercises/concept/football-match-reports/.meta/design.md +++ b/exercises/concept/football-match-reports/.meta/design.md @@ -1 +1,50 @@ # Design + +## Learning objectives + +- Know the existence of the `Switch` statement. +- Know how to use the switch statement. +- Recognize the keywords `switch`, `case`, `break` and `default`. + +## Out of scope + +- Nested switch statements +- Advanced switch statements features like using object as case values. + +## Concepts + +- `switch`: know the existence of the `Switch` statement, how to use it and how to apply the basic keywords. + +## Prerequisites + +This exercise's prerequisites Concepts are: + +- `classes`: know how to work with classes. + +## Analyzer + +This exercise could benefit from the following rules in the [analyzer]: + +- `essential`: If the student resolved the exercise without using `switch`, instruct them to do so. +- `actionable`: If the solution returns the same value in different cases, instruct them that this could be simplified. + +```java +switch(shirtNum) { + case 6, 7, 8: + return "midfielder"; +} +``` + +- `actionable`: If the student does not directly return the answer from the case in the switch statement, instruct them to do so. +- `informative`: If the solution is returning the answer inside the cases, inform the student that it can be simplified to by directly returning the switch statement and using arrow functionality. + +```java +return switch(shirtNum) { + case 6, 7, 8 -> "midfielder"; +} +``` + +If the solution does not receive any of the above feedback, it must be exemplar. +Leave a `celebratory` comment to celebrate the success! + +[analyzer]: https://github.com/exercism/java-analyzer From 78c411f1819cb853207947487f4326d10b553aab Mon Sep 17 00:00:00 2001 From: Manuel Maxera <95315128+manumafe98@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:08:19 -0300 Subject: [PATCH 2/3] Update exercises/concept/football-match-reports/.meta/design.md Co-authored-by: Sander Ploegsma --- exercises/concept/football-match-reports/.meta/design.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/concept/football-match-reports/.meta/design.md b/exercises/concept/football-match-reports/.meta/design.md index 3f54e6be8..847e309a2 100644 --- a/exercises/concept/football-match-reports/.meta/design.md +++ b/exercises/concept/football-match-reports/.meta/design.md @@ -36,7 +36,7 @@ switch(shirtNum) { ``` - `actionable`: If the student does not directly return the answer from the case in the switch statement, instruct them to do so. -- `informative`: If the solution is returning the answer inside the cases, inform the student that it can be simplified to by directly returning the switch statement and using arrow functionality. +- `informative`: If the solution is returning the answer inside the cases, inform the student that it can be simplified by using a switch expression: ```java return switch(shirtNum) { From 934acf1ad70d648606c28b27b32665d9f579da6d Mon Sep 17 00:00:00 2001 From: manumafe98 Date: Thu, 1 Feb 2024 12:10:36 -0300 Subject: [PATCH 3/3] Indenting snippets by two spaces --- .../football-match-reports/.meta/design.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/exercises/concept/football-match-reports/.meta/design.md b/exercises/concept/football-match-reports/.meta/design.md index 847e309a2..a4e3c279c 100644 --- a/exercises/concept/football-match-reports/.meta/design.md +++ b/exercises/concept/football-match-reports/.meta/design.md @@ -28,21 +28,21 @@ This exercise could benefit from the following rules in the [analyzer]: - `essential`: If the student resolved the exercise without using `switch`, instruct them to do so. - `actionable`: If the solution returns the same value in different cases, instruct them that this could be simplified. -```java -switch(shirtNum) { - case 6, 7, 8: - return "midfielder"; -} -``` + ```java + switch(shirtNum) { + case 6, 7, 8: + return "midfielder"; + } + ``` - `actionable`: If the student does not directly return the answer from the case in the switch statement, instruct them to do so. - `informative`: If the solution is returning the answer inside the cases, inform the student that it can be simplified by using a switch expression: -```java -return switch(shirtNum) { - case 6, 7, 8 -> "midfielder"; -} -``` + ```java + return switch(shirtNum) { + case 6, 7, 8 -> "midfielder"; + } + ``` If the solution does not receive any of the above feedback, it must be exemplar. Leave a `celebratory` comment to celebrate the success!