final int SECONDS_PER_MINUTE = 60;

int minutesIn(int totalSeconds) {
    return totalSeconds / SECONDS_PER_MINUTE;
}

int secondsLeft(int totalSeconds) {
    return totalSeconds % SECONDS_PER_MINUTE;
}

void main() {
    int total = 500;
    IO.println(minutesIn(total) + " minutes and " + secondsLeft(total) + " seconds");
}

// From Groundwork, chapter 6 (ch06-methods), box 14.
// This example is from Groundwork, licensed CC BY-NC-SA 4.0.
// Run with: java ch06_14.java
