Exercise - Demonstrate your knowledge of control structures.
ControlStructures
. It should not inherit from any other contracts and does not need a constructor. It should have the following functions:
fizzBuzz
that accepts a uint
called _number
and returns a string memory
. The function should return:
_number
is divisible by 3_number
is divisible by 5_number
is divisible by 3 and 5doNotDisturb
that accepts a uint
called _time
, and returns a string memory
. It should adhere to the following properties:
_time
is greater than or equal to 2400, trigger a panic
_time
is greater than 2200 or less than 800, revert
with a custom error of AfterHours
, and include the time provided_time
is between 1200
and 1259
, revert
with a string message “At lunch!”_time
is between 800 and 1199, return “Morning!”_time
is between 1300 and 1799, return “Afternoon!”_time
is between 1800 and 2200, return “Evening!”