Return the totalSeconds parameter written as minutes, a colon, then seconds.
timeText(135) returns "2:15".
7 strips: K1 to K7
} K1return text; K2String text = minutes + ":" + seconds; K3int seconds = totalSeconds / 60; K4int minutes = totalSeconds / 60; K5public static String timeText(int totalSeconds) { K6int seconds = totalSeconds % 60; K7Order: K6, K5, K7, K3, K2, K1. Extra: K4
Lines with the same mark can go in either order.
public static String timeText(int totalSeconds) {
int minutes = totalSeconds / 60;
int seconds = totalSeconds % 60;
String text = minutes + ":" + seconds;
return text;
} Extra strip: int seconds = totalSeconds / 60;. totalSeconds / 60 is the number of whole minutes again. The seconds left over are totalSeconds % 60.