Skip to content
Snippets Groups Projects
Commit bd3dbb23 authored by FOURNEL Alexandre's avatar FOURNEL Alexandre
Browse files

task 4

parent 26ed607a
No related branches found
No related tags found
No related merge requests found
...@@ -13,17 +13,23 @@ public class PrintHourTicable implements Tickable{ ...@@ -13,17 +13,23 @@ public class PrintHourTicable implements Tickable{
} }
public void notifyTick(){ public void notifyTick(){
int minuteur = 10; //int minuteur = 10;
if (seconds >= 60){seconds = 0; minutes ++;} if (seconds >= 60){seconds = 0; minutes ++;}
if (minutes >= 60){minutes = 0; hour ++;} if (minutes >= 60){minutes = 0; hour ++;}
if (hour >= 24) {hour = 0;} if (hour >= 24) {hour = 0;}
PrintHourTicable test = new PrintHourTicable(hour, seconds, minutes);
System.out.println(String.format("%02d:%02d:%02d", hour , minutes, seconds++)); System.out.println(String.format("%02d:%02d:%02d", hour , minutes, seconds++));
if (unit == minuteur){System.out.println("dring dring");} test.alarme(7,0,0);
unit ++; //if (unit == minuteur){System.out.println("dring dring");}
//unit ++;
} }
//public void alarme(int hour, int minutes, int seconds){if (this.hour == hour && this.minutes == minutes && this.seconds == seconds){System.out.println("wake up !");}} public void alarme(int hour, int minutes, int seconds){
if (this.hour == hour && this.minutes == minutes && this.seconds == seconds){
System.out.println("wake up !");
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment