package class_09_30_2014;

import java.util.Scanner;

public class Driver {

	public static void main(String[] args) {
		Scanner console = new Scanner(System.in);
		
//		System.out.println("Enter number of dogs: ");		
//		String dogs = console.nextLine();
//		int numberDogs = Integer.parseInt(dogs);

//		System.out.println("Enter number of cats: ");		
//		String cats = console.nextLine();
//		int numberCats = Integer.parseInt(cats);	

		double numberDogs = 30;    // This will be an implicit cast
		double numberCats = 0;  // This is not an implicit cast, all is double
		int numberSnakes = 4;
		
		// The smallest legal Java statement follows
		;  // A naked semicolon does NOTHING.  But it is still a statement.
		
		String owner = "Dennis";
		
		if (numberDogs >= 4) {
			System.out.println("You have too many dogs.");
			System.out.println("Sell some of them.");
		}
		if (numberCats > 1) System.out.println("You have too many cats");
		
		// This is the preferred way to do an if...even if you have only one statement
		if (numberCats > 1) {
			System.out.println("You really do have too many cats.");
		}
		
		// This is going to be an error.  the semicolon does not belong here.
		if (numberCats > 1); {
			System.out.println("I'm serious.  You really do have too many cats.");
		}		
		
		
		{
			// Hey look at this.   I just put a block of code right here.
			String hi = "Hello";
			System.out.println("Hello");
		}
		// This next line will not compile, because the variable hi is not in scope.
		// System.out.printf("I wonder if the variable hi is still known? %s.", hi);
		
		System.out.println("You have " + numberCats + " cats.");
		
		
		
		// %s used for Strings.  %d used for integers.  %f used for decimals.
		
/*		System.out.println(owner + " has " + (numberDogs + numberCats) + " pets.");
		System.out.printf("%s has %18.3f dogs and %2.0f cats.", owner, numberDogs, numberCats);
		System.out.printf("\n\n\tFor a total of %1.1f pets.", numberDogs + numberCats);
		
		System.out.printf("\n\t%16.2f", numberDogs);
		System.out.printf("\n\t%16.2f", numberCats);
		System.out.printf("\n\tYou have %12d snakes", numberSnakes);
		
		System.out.printf("\nActor\\Writer");  // Use double \\ to print one \
		System.out.printf("\nThis is a slash /");
*/
	}

}
