/*
 * Code18.java
 * Dan Armendariz
 * Computer Science 76
 * Building Mobile Applications
 *
 * A brief introduction to methods.
 *
 */
 
class Code18 {

	private static void printSuccess(Car myCar) {
		System.out.println("Wow, your "+myCar.getYear()+" "+myCar.getMake()+
						   " "+myCar.getModel()+" is really booking it at "+
						   myCar.getSpeed()+" mph!");

	}

	private static void printFailure(Car myCar) {
		System.out.println("Too bad, your "+myCar.getYear()+" "+myCar.getMake()+
						   " "+myCar.getModel()+" can't go that fast.");
	}

	public static void main(String [] args) {
		Car tortoise = new Car("Toyota", "Camry", 2009);
		Car hare = new Car("Ferrari", "F430", 2009);
		
		tortoise.setMaxSpeed(100.0);
		hare.setMaxSpeed(200.0);
		
		if(hare.setSpeed(155.0))
			printSuccess(hare);
		else
			printFailure(hare);
		
		if(tortoise.setSpeed(135.0))
			printSuccess(tortoise);
		else
			printFailure(tortoise);
	}


}