// // Supporting material for lecture 4 // - cooking meat // - tell them when to put it in the oven! // import FormatIO.*; public class Cooking { public static void main(String[] args){ } } // // The algorithm (what's an algorithm?) // // (1) get the cooking algorithm // (1.1) minutes per kilogram (minPerKg) // (1.2) additional time (addTime) // (1.3) assume that data is integer // // (2) get time to be ready (readyTime) // (2.1) read time in 24 hour notation HHMM // (2.2) again assume integer (i.e. no parts of a minute) // // (3) get weight of meat (weight) // (3.1) assume double/float // // NOTE: could reorder steps 1, 2, and 3 // // (4) compute start time (startTime) // (4.1) convert readyTime from HHMM to just minutes // (4.1.1) hours = readtyTime /100, mins = readyTime % 100 // (4.1.2) timeInMins = ??? or just put it back into readyTime? // (4.2) compute cooking time (cookTime) // (4.2.1) weight * minPerKg + addTime // (4.2.2) woops! is this an integer or double? // (4.3) startTime = readyTime - cookTime // (4.4) Now convert startTime to HHMM // // NOTE: // - could startTime go negative? // - what would that mean? // - can we fix this //