Question: Create an app using a switch statement to manage user greetings based on the time of day: If the current time is before 8 :

Create an app using a switch statement to manage user greetings based on the time of day: If the current time is before 8:00 PM, display a greeting message: "Good morning". Save this message in a cookie to indicate that the user is already logged in. If the time is after 8:00 PM, display the message: "Good night". If the user is not logged in, redirect them to the login route. After successful login, the appropriate greeting should be displayed based on the time of day.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!