// COMP 1631 (Fall 2006) // Author(s): 1631 instructors // // Lab Test code - Tuesday solution // // This class is just a holder for the main method where students are required // to insert code (that will involve if statements). public class IffyTuesday { public static void main(String[] args) { int numWheels, weight; numWheels = Console.readInt("Enter the number of wheels: "); weight = Console.readInt("Enter the weight (in kg): "); if ((numWheels == 4) && (weight < 2000)) { System.out.println("This is a car."); } // if else if ((numWheels == 6) && (weight > 4000)) { System.out.println("This is a bus."); } // else if else { System.out.println("This is neither a car nor a bus."); } // else } // end main } // end class IffyTuesday