Question: Question about Html / JavaScript Write a defining table and then a program that determines if you can sleep in or not. Your program should
Write a defining table and then a program that determines if you can sleep in or not. Your program should get all its input from your computer's clock. On all weekdays (Monday through Friday) that are not holidays, your program should output "Get up!" On all other days (weekends and holidays), your program should output "Sleep in." The three holidays that your program must check for are January 1 (New Year's Day), July 4 (U.S Independence Day), and December 25 (Christmas). You don't need to include other holidays in your program because most other holidays do not occur on a fixed day each year. Within your program, use this JavaScript code that will get the current month, current day of the month, and current day of the week from your computer's clock: var now new Date() ; var month = now.getMonth(); var dayofMonth = now.ge t Date(); var dayofweek now. getDay(); If you use the above code, the variable month will hold 0 if the current month is January, 1 if February, and so on to 11 if December. The variable dayofMonth will hold 1 for the first day of the month up to 28, 29, 30, or 31 for the last day of the month. The variable dayOfWeek will hold 0 if today is Sunday, 1 if today is Monday, and so on to 6 if today is Saturday
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
