Chapter 2! Woo!!

2.1 First created the ticket object w/ a ticket price of 200 cents. I inserted 600 cents, and then printed a ticket. Subsequent balance is 0 cents. Bummer about exact change.

2.2 The balance is zero cents after the ticket has been provided.

2.3 NO REFUNDS. NO EXTRA TICKETS. WHAT AM I SUPPOSED TO DO WITH MY 6 DOLLAR BILL.

2.4 Well, it's nice that if you insert too little money, it still gives you the ticket. You can even print the ticket without giving any money at all (no checks for the balance of the machine seem to exist at all. It just sets the balance to zero every time you get a ticket, and adds to the balance whenever you add money.)

2.5 The only difference is that it reflects the correct price at the bottom of the ticket.

2.6 classes for Student or LabClass --

	public class Student {
	}
	public class LabClass {
	}

2.7 No good! If you change the order of public and class in the outer wrapper of the class, you get a complier error.

2.8 It says "class has to be compiled to set breakpoints, which isn't really super duper helpful. 

2.9 Fields in TicketMachine:

	private int price;
	private int balance;
	private int total;

    Constructor:
	
	public TicketMachine(int ticketCost) {code}

    Methods:

	getPrice();
	getBalance();
	insertMoney();
	printTicket();

2.10 The constructor is named after the class!

2.11 
	private int count;
  	private Student representative;
  	private Server host;

	count is an int, representative is a Student, host is a Server

2.12 	private boolean alive;
  	private Person tutor;
  	private Game game;

	the names are alive, tutor, and game.

2.13 It super matters what the order is. Getting the same "Class has to be compiled to set breakpoints" again, which is starting to mean something to me. Woo!

2.14 It is extra important to have semi-colons. 

2.15 declared an int named status.

2.16 public Student(String name) -- the constructor belongs to class Student.

2.17 public Book(String title, double price) -- there are two parameters, one of type thing, and the other of type double.

2.18 Book's fields might be something like length, title, author genre, etc. They might be mostly Strings.

2.19 public Pet(String petsName) { name = petsName; }

2.20 price is already a declared variable within the scope of Class TicketMachine. You'll get a compiler error if you try to declare it again. 

2.21 getBalance and getPrice return the value of two different variables.

2.22 getBalance is "How much money is in the machine?"

2.23 Nope. You can still return balance on getAmount. It's the same thing.

2.24 added a getTotal method.

2.25 missing return statement if you say your method will return something but it doesn't.

2.26 Print ticket doesn't return anything (void)

2.27 insertMoney and printTicket don't have return statements because they aren't supposed to return anything, per their method signatures.

2.28 Yep. That's how it works.

2.29 Constructors don't have return indicators.

2.30 did it.

2.31   /**
   * Increase score by the given number of points.
   */
  public void increase(int points)
  {
	score += points;
  }

2.32 /**
   * Reduce price by the given amount.
   */
  public void discount(int amount)
  {
	price -= amount;
  }

2.33 public void prompt(){
        System.out.println("Please insert correct change");
    }

2.34 public void showPrice(){
        System.out.println("The price of a ticket is " + price + " cents.");
    }

2.35 They have different outputs, because the output depends on the value of price. (Different objects of the same class)

2.36 If you put quotes around a variable name, it ceases to be a variable name, and becomes a String. So it would just display "price", not the value of price.

2.37 That's the same as above.

2.38 No, because you're not referring to a variable. 

2.39 If you modify the constructor that way, you'll generate a TicketMachine with no input required, and the price of tickets will always be 1000 cents. You can modify this with the setPrice method.

2.40 made the method. It doesn't need parameters, because it will always do the same thing. 

2.41 I feel like this was already an exercise.

2.42 cool. Done.

