2.1 ##################
# The BlueJ Line
# Ticket
# 500 cents.
##################

2.2   500 cents

2.3.  ##################
# The BlueJ Line
# Ticket
# 500 cents.
##################

##################
# The BlueJ Line
# Ticket
# 500 cents.
##################

##################
# The BlueJ Line
# Ticket
# 500 cents.
##################

2.5 the printed value is different

2.6 

{
Methods
Const
Variables 
}

2.7 Yes this will cause an error

2.8 It is possible no syntactical error. 

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

        const - 
        price 
        balance
        total 

	TicketMachine
	getPrice
	balance
	insertMoney
	printTicket

2.10  price = ticketCost;
        balance = 0;
        total = 0;
	the prices seems to be set 

Exercise 2.11 What do you think is the type of each of the following fields?
private int count;   	INT
private Student representative; 	STRING
private Server host;	STRING

Exercise 2.12 What are the names of the following fields?
private boolean alive;
private Person tutor;
private Game game;

Exercise 2.13 In the following field declaration from the TicketMachine class
private int price;
does it matter which order the three words appear in? Edit the TicketMachine class to
try different orderings. After each change, close the editor. Does the appearance of the
class diagram after each change give you a clue as to whether or not other orderings are
possible? Check by pressing the Compile button to see if there is an error message.
Make sure that you reinstate the original version after your experiments!

Exercise 2.14 Is it always necessary to have a semicolon at the end of a field declaration?
Once again, experiment via the editor. The rule you will learn here is an
important one, so be sure to remember it. 

	YES, the java lang read needs a semicolon to read statements

Exercise 2.15 Write in full the declaration for a field of type int whose name is
status.

Exercise 2.16 To what class does the following constructor belong?
public Student(String name)

Exercise 2.17 How many parameters does the following constructor have and
what are their types?
public Book(String title, double price)

2 params, String & double

Exercise 2.18 Can you guess what types some of the Book class’s fields might
be? Can you assume anything about the names of its fields?

Exercise 2.19 Suppose that the class Pet has a field called name that is of type
String. Write an assignment statement in the body of the following constructor so
that the name field will be initialized with the value of the constructor’s parameter.
public Pet(String petsName)
{
...
}
Exercise 2.20 Challenge exercise What is wrong with the following version of the
constructor of TicketMachine?
public TicketMachine(int ticketCost)
{
int price = ticketCost;
balance = 0;
total = 0;
}
TICKETCOST IS ALREADY ASSIGN AS AN INT.