Question: Daily Greeting You are tasked with writing code that greets the user with a custom message corresponding to the current day of the week. The

Daily Greeting
You are tasked with writing code that greets the user with a custom message corresponding to the current day of the week. The variable day is provided to you and its values are the test cases. The program should print the provided greetings below in a switch statement:
Monday: "Hello! It's Monday. Time to start the week!"
Tuesday: "Hello! It's Tuesday. Keep pushing forward!"
Wednesday: "Hello! It's Wednesday. Midweek already!"
Thursday: "Hello! It's Thursday. Almost there!"
Friday: "Hello! It's Friday. Weekend is coming!"
Saturday: "Hello! It's Saturday. Enjoy your weekend!"
Sunday: "Hello! It's Sunday. Have a relaxing day!"
If the input day is not recognized (i.e., not one of the seven days of the week), the program should still provide a friendly generic greeting message: "Hello! Have a great day!"
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class CodingQuestion {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
String day = in.next();
/*** DO NOT CHANGE CODE ABOVE THIS LINE**/
//Write your code here:
}
}

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!