THis is the assignment:
Write a program that does the following:
Declare a set of seven integer constants named MONDAY, TUESDAY, ... , SUNDAY. Set MONDAY to 1, TUESDAY to 2, and so forth. Then, create an integer variable named day_of_week and initialize it with some integer value. If the value of day_of_week is 1, the program should display Today is Monday. If the value is 7, the program should display Today is Sunday, and so forth. If the value is not in the range 1-7, the program should display the message Invalid Data. Use a switch construct and the defined constants.
This is what I did could you check?
public class DaysOfWeek
{
public static void main (String [] args)
{
int Monday=1;
int tuesday=2;
int wednesday=3;
int thursday=4;
int friday=5;
int saturday=6;
int sunday=7;
int day_of_week = 1;
switch(day_of_week)
{
case 1:
System.out.println("today is monday");
break;
case 2:
System.out.println("today is tuesday");
break;
case 3:
System.out.println("today is wednesday");
break;
case 4:
System.out.println("today is thursday");
break;
case 5:
System.out.println("today is friday");
break;
case 6:
System.out.println("today is saturday");
break;
case 7:
System.out.println("today is sunday");
break;
default:
System.out.println("Invalid Data");
break;
}
}
}