
public class MiscMethods {
	public static void main(String[] args) {
		test24To12();
	}

	public static int convert24To12(int hour24Value) {
		int hour12Value = hour24Value;
		if (hour24Value > 12) {
			hour12Value -= 12;
		}
		return hour12Value;
	}
	
	public static void test24To12() {
		System.out.print("Testing convert24To12(): ");
		int hour = convert24To12(0);
		assert hour == 0;
		hour = convert24To12(12);
		assert hour == 12;
		hour = convert24To12(13);
		assert hour == 1;
		hour = convert24To12(24);
		assert hour == 12;
		System.out.print(" Passed!");
	}
}
