/*EBU4201(2021/22) lab1- question2- WeekDayConventer.java
Reads value from 1 to 7, putout Weekdays by if...else or switch statement
eg. java WeekDayConverter 4 :the 4th day is Thursday */
public class WeekDayConverter {
public static void main(String[] args){
int weekDay =Integer.parseInt(args[0]);
if( weekDay == 1){
System.out.print("The " + weekDay + "th day of the week is ");
System.out.println("Monday.");
}
else if( weekDay == 2){
System.out.print("The " + weekDay + "th day of the week is ");
System.out.println("Tuesday.");
}
else if( weekDay == 3){
System.out.print("The " + weekDay + "th day of the week is ");
System.out.println("Wednesday.");
}
else if( weekDay == 4){
System.out.print("The " + weekDay + "th day of the week is ");
System.out.println("Thursday.");
}
else if( weekDay == 5){
System.out.print("The " + weekDay + "th day of the week is ");
System.out.println("Friday.");
}
else if( weekDay == 6){
System.out.print("The " + weekDay + "th day of the week is ");
System.out.println("Saturday.");
}
else if( weekDay == 7){
System.out.print("The " + weekDay + "th day of the week is ");
System.out.println("Sunday.");
}
else{
System.out.println("INPUT ERROR !!");
}
}
}