If you complete the method correctly the output of

This preview shows page 6 - 12 out of 23 pages.

If you complete the method correctly, the output of the following method calls: printTime(15); printTime(60); printTime(135); should be: 0 minutes and 15 seconds 1 minutes and 0 seconds 2 minutes and 15 seconds Complete the printTime() method in the space provided below: private void printTime (int totalSeconds) { int numberOfSeconds, numberOfMinutes; numberOfMinutes = totalSeconds / 60; numberOfSeconds = totalSeconds % 60; System.out.print(numberOfMinutes + " minutes"); System.out.print(" and "); System.out.println(numberOfSeconds + " seconds"); } (8 marks)
Image of page 6

Subscribe to view the full document.