Challenge: Find If the Day Is a Weekend

This challenge requires you to make an enum method.

Problem Statement

  • An enum Days has been provided to you. It has all the days of the week.
  • A method is_weekend() is incomplete.
  • The task is to complete the method
    • If the day is a weekend it returns 1
    • If the day is a weekday it returns 0

Input

  Day of the Week

Note: Assume that days of the week are passed to the function

Output

   1  or  0

Sample Input

   Wednesday

Sample Output

   0

Coding Exercise

Write your code below. It is recommended​ that you try solving the exercise yourself before viewing the solution.

Note: There is a test function given in the code for testing purposes. Do not modify it.

Good luck!🤞

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy