Skip to content

Commit

Permalink
Enable grade-calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
solar05 committed Oct 1, 2023
1 parent 36e08e1 commit 7665e04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/battle_asserts/issues/grade_calculator.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
(def tags ["strings" "collections"])

(def description
{:en "Calculate grade of five student subjects. If grade average is bigger than 90, final grade is A. If grade average is bigger than 80, final grade is B. If grade average is bigger than 70, final grade is C. If grade average is bigger than 60, final grade is D. In other cases final grade is F."
:ru "Рассчитайте финальную оценку студента по пяти предметам. Если средняя оценка больше 90, то итоговая `A`. Если средняя оценка больше 80, то итоговая `B`. Если средняя оценка больше 70, то итоговая оценка `C`. Если средняя оценка больше 60, то итоговая оценка `D`. В остальных случаях итоговая оценка `F`."})
{:en "Calculate grade of five student subjects. If grade average is bigger than 90, final grade is A. If grade average is bigger than 80, final grade is B. If grade average is bigger than 70, final grade is C. If grade average is bigger than 60, final grade is D. In other cases final grade is F. Use floor rounding."
:ru "Рассчитайте финальную оценку студента по пяти предметам. Если средняя оценка больше 90, то итоговая `A`. Если средняя оценка больше 80, то итоговая `B`. Если средняя оценка больше 70, то итоговая оценка `C`. Если средняя оценка больше 60, то итоговая оценка `D`. В остальных случаях итоговая оценка `F`. Оценку округлите в меньшую сторону."})

(def signature
{:input [{:argument-name "numbers" :type {:name "array" :nested {:name "integer"}}}]
Expand All @@ -33,7 +33,7 @@
:expected "Grade: F"}])

(defn solution [grades]
(let [avg-grade (int (/ (apply + grades) 5))]
(let [avg-grade (int (Math/floor (/ (apply + grades) 5)))]
(cond
(> avg-grade 90) "Grade: A"
(> avg-grade 80) "Grade: B"
Expand Down
2 changes: 1 addition & 1 deletion src/battle_asserts/issues/hamming_numbers.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(def level :medium)

(def tags ["math"])
(def tags ["math" "algorithms"])

(def description
{:en "The sequence of Hamming numbers 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36, …
Expand Down

0 comments on commit 7665e04

Please sign in to comment.