I have provided a function that is supposed to return the name of a day of the week given the day number.
Do not re-type this code. Simply download a copy of the file by right-clicking and choosing "Save link as..." from the context menu. Save it into your normal code folder.
Add code where indicated so that the function returns the given weekday name for 0-7, or "ERROR" for any other number.
Weekday 1: Sunday Weekday 2: Monday Weekday 3: Tuesday Weekday 4: Wednesday Weekday 5: Thursday Weekday 6: Friday Weekday 7: Saturday Weekday 0: Saturday Weekday 43: ERROR Weekday 17: ERROR Weekday -1: ERROR Weekday 12: ERROR Today is a Wednesday!
©2003–2016 Graham Mitchell
This assignment is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.