// // Supporting material for lecture 5 // - validating time // import FormatIO.*; public class Demo05 { public static void main(String[] args){ int time = Integer.parseInt(args[0]); // (0) int hours = time / 100; // (1) int minutes = time % 100; System.out.println(time + " " + hours + " " + minutes); boolean legal = hours < 24 && minutes < 60; // (2) System.out.println(legal); } } // // (0) read in an integer time from command line // (1) Why 100? Why not 60? // (2) What is a legal time? // (3) Can we be neater/shorter? // (4) Can we get it to use the console? //