Skip to content

Commit

Permalink
Add Java analyzer comments for Leap (#2316)
Browse files Browse the repository at this point in the history
* Add comment about using built-in methods

* Additional comments
  • Loading branch information
sanderploegsma authored Jan 22, 2024
1 parent 88a7012 commit 3233c67
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions analyzer-comments/java/leap/avoid_conditional_logic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# avoid conditional logic

Consider converting the `if`-statement(s) and/or ternary expressions into a single expression using the `&&` and `||` operators.
8 changes: 8 additions & 0 deletions analyzer-comments/java/leap/no_built_in_methods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# no built-in methods

Hey there, sneaky!
The purpose of this exercise is to write the logic for checking leap years yourself.
Solve it without using built-in methods from:

- The `java.time` module;
- The `java.util.GregorianCalendar` class.
3 changes: 3 additions & 0 deletions analyzer-comments/java/leap/use_minimum_number_of_checks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# use minimum number of checks

Try reducing the number of checks to just three (hint: check the instructions).

0 comments on commit 3233c67

Please sign in to comment.