Contract
Create a single contract calledControlStructures. It should not inherit from any other contracts and does not need a constructor. It should have the following functions:
Smart Contract FizzBuzz
Create a function calledfizzBuzz that accepts a uint called _number and returns a string memory. The function should return:
- “Fizz” if the
_numberis divisible by 3 - “Buzz” if the
_numberis divisible by 5 - “FizzBuzz” if the
_numberis divisible by 3 and 5 - “Splat” if none of the above conditions are true
Do Not Disturb
Create a function calleddoNotDisturb that accepts a uint called _time, and returns a string memory. It should adhere to the following properties:
- If
_timeis greater than or equal to 2400, trigger apanic - If
_timeis greater than 2200 or less than 800,revertwith a custom error ofAfterHours, and include the time provided - If
_timeis between1200and1259,revertwith a string message “At lunch!” - If
_timeis between 800 and 1199, return “Morning!” - If
_timeis between 1300 and 1799, return “Afternoon!” - If
_timeis between 1800 and 2200, return “Evening!”