Created
October 16, 2019 20:25
-
-
Save malte-j/10ae5030c90996b6995d1019b251d7d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void berechneRestZeitVonSchicht(int std, int min) { | |
int schicht = std / 8 + 1; | |
int volleMinuten = std * 60 + min; | |
int minutenEnde = schicht * 8 * 60; | |
int minutenBisEnde = minutenEnde - volleMinuten; | |
int stundenBisEnde = minutenBisEnde / 60; | |
int minutenFormattiert = minutenBisEnde % 60 - 1; | |
System.out.printf("Anfrage um: %d:%d%n", std, min); | |
System.out.printf("Aktuelle Schicht: %d%n", schicht); | |
System.out.printf("Restliche Zeit in der Schicht: %d Stunden, %d Minuten%n", stundenBisEnde, minutenFormattiert); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment