error message

The error message is 'lastSTATE' was not declared in this scope

And here is the part it says it at:

/*
IR Breakbeam sensor demo!
*/

#define LEDPIN 13
//Pin 13:Arduino has an LED connected on pin 13
//Pin 11:Teensy 2.0 has the LED on pin 11
//Pin 6:Teensy++ 2.0 has the LED on pin 6
//Pin 13:Teensy 3.0 has the LED on pin 13

#define SENSORPIN 4

//variables will change:
int sensorSTATE = 0, lastState=0; //variable for reading the pushbutton status

void setup() {
//initialize the LED pin as an output:
pinMode(LEDPIN, OUTPUT);
//initialize the sensor as an input:
pinMode(SENSORPIN, INPUT);
digitalWrite(SENSORPIN, HIGH); // turn on the pullup

Serial.begin(9600);
}

void loop(){
//read the state of the pushbutton value:
sensorSTATE = digitalRead(SENSORPIN);

//check if the sensor beam is broken
//if it is, the sensorState is LOW:
if (sensorSTATE == LOW) {
// turn LED on:
digitalWrite(LEDPIN, HIGH);
}
else {
// turn LED off:
digitalWrite(LEDPIN, LOW);
}

if (sensorSTATE && !lastSTATE) { (the error is for this line)
Serial.printIn("Unbroken");
}
if (!sensorState && lastSTATE) {
Serial.printIn("Broken");
}
lastState = sensorSTATE;
}

lastState != lastSTATE

Please remember to use code tags when posting code

lastState and lastSTATE are not the same variables neither are sensorState and sensorSTATE.

You must spell out the variable names identically or declare a new variable.