I couldn't get how to finish this program that was tasked to us and it's about setting an alarm by creating and implementing an interface.
This is the instructions that was given to us.
Procedure/Instructions
Now this is what I finished so far on my code:
import java.util.Scanner;
import java.time.LocalTime;
public class Monday {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter time for alarm in this format (HH:MM): ");
int enteredAlarm = poli.nextInt();
if{
}
else if{
}
}
}
interface Alarm {
public void setAlarm(String time) {
}
public void showAlarm() {
LocalTime alarm = LocalTime.parse(time);
LocalTime now = LocalTime.now();
}
}
abstract class Weekday implements Alarm {
}
class Monday extends Weekday {
}
Now this is what the expected output is, which I cannot finish because I don't know how to display it by using user input, and the instructions that was given to us is confusing (Which is on the image above).
Enter time for alarm in this format (HH:MM): 05:30
Alarm is set for tomorrow!