import java.io.PrintStream; public class Test2C { public static void main(String[] args) { PrintStream out = System.out; final int START = Integer.parseInt(args[0]); final int STOP = Integer.parseInt(args[1]); final int SEC_PER_MIN = 60; /* For a maximum of 10 / 10: Start with a for loop that counts from START up to STOP (inclusive). Dividing the loop counter by 60 gives the number of minutes, and finding the remainder after dividing by 60 gives the number of seconds. To get the leading zeros in front of the seconds (from 0 to 9), you can use printf or an if statement. */ for (int i = START; i <= STOP; i++) { int min = i / SEC_PER_MIN; int sec = i % SEC_PER_MIN; out.printf("%d:%02d%n", min, sec); /* or use an if statement instead of printf final int NEED_ZERO = 10; out.print(min + ":"); if (sec < NEED_ZERO) { out.print("0"); } out.println(sec); */ } } }