/ Time.java // Purpose support the representation of Time type objects public class Time{ private int hours; private int minutes; String ampm; public Time (int h, int m, String ab){ if (h >= 1 && h <= 12 && m >= 0 && m <= 59 && (ab.equals("AM") || ab.equals("PM"))){ hours = h; minutes = m; ampm = ab; } else { hours = 12; minutes = 0; ampm = "AM"; System.out.println("Invalid Time ? setting to 12:00am."); } } public String toString(){ String result = hours + ":" + minutes; return result; } }