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

task 5

parent bd3dbb23
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -13,21 +13,23 @@ public class PrintHourTicable implements Tickable{ ...@@ -13,21 +13,23 @@ public class PrintHourTicable implements Tickable{
} }
public void notifyTick(){ public void notifyTick(){
//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); PrintHourTicable test = new PrintHourTicable(hour,minutes, seconds);
System.out.println(String.format("%02d:%02d:%02d", hour , minutes, seconds++)); System.out.println(String.format("%02d:%02d:%02d", hour , minutes, seconds++));
test.alarme(7,0,0); unit ++;
//if (unit == minuteur){System.out.println("dring dring");} test.alarme(0,0, 10,10);
//unit ++;
} }
public void alarme(int hour, int minutes, int seconds){ public void alarme(int hour, int minutes, int seconds, int rep){
if (unit == rep){
System.out.println("Debout c'est vraiment l'heure");
}
if (this.hour == hour && this.minutes == minutes && this.seconds == seconds){ if (this.hour == hour && this.minutes == minutes && this.seconds == seconds){
System.out.println("wake up !"); System.out.println("Debout c'est l'heure !");
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment