Write a java program that reads a day number (1 to 7) and checks whether it is a weekend or weekday. Day 1 is Sunday and day 7 is Saturday.
(without using scanner)
Answers
Answered by
2
Answer:
class Program extends Thread {
public static void Main (String[] args) {
Int num = 0;
while(true) {
num = num +1;
switch(num):
case 1: System.out.printLn("Mon");
case 2: System.out.printLn("Tue");
....
case 7: {
System.out.printLn("Sun");
num = 0
}
}
}
}
}
Similar questions