Arduino Starter Kit error (11th project) 'prevSwitchState' was not declared in this scope

I have made it to the 11th project of the starter kit.
When i compiled the code, it gave me an error:

'prevSwitchState' was not declared in this scope

I don't know what's wrong. I typed everything out of the projects book, but it didn't show how to make the previous switch state variable.
Can you help me?
Here's the code if you need it:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int switchPin = 6;
int switchState = 0;
int reply;
void setup() {
  lcd.begin(16, 2);
  pinMode(switchPin, INPUT);
  lcd.print ("Ask the");
  lcd.setCursor(0, 1);
  lcd.print("Crystal Ball!");
}
void loop() {
  switchState =digitalRead(switchPin);
  if (switchState != prevSwitchState)
    if (switchState == LOW) {
      reply = random(8);
      lcd.clear();
      lcd.setCursor(0, 1);
      switch(reply){
        case 0:
        lcd.print("Yes");
        break;
        case 1:
        lcd.print("Most likely");
         break;
        case 2:
        lcd.print("Certainly");
         break;
        case 3:
        lcd.print("Outlook good");
         break;
        case 4:
        lcd.print("Unsure");
         break;
        case 5:
        lcd.print("Ask again");
         break;
        case 6:
        lcd.print("Doubtful");
         break;
        case 7:
        lcd.print("No");
        break;
      }
    }
}

Here's the error:

C:\Users\vados\AppData\Local\Arduino15\RemoteSketchbook\ArduinoCloud\58373ecb-0049-4b7c-87cc-64c1599e2523\Crystal_Ball\Crystal_Ball.ino: In function 'void loop()':
C:\Users\vados\AppData\Local\Arduino15\RemoteSketchbook\ArduinoCloud\58373ecb-0049-4b7c-87cc-64c1599e2523\Crystal_Ball\Crystal_Ball.ino:15:22: error: 'prevSwitchState' was not declared in this scope
   if (switchState != prevSwitchState)
                      ^~~~~~~~~~~~~~~
C:\Users\vados\AppData\Local\Arduino15\RemoteSketchbook\ArduinoCloud\58373ecb-0049-4b7c-87cc-64c1599e2523\Crystal_Ball\Crystal_Ball.ino:15:22: note: suggested alternative: 'switchState'
   if (switchState != prevSwitchState)
                      ^~~~~~~~~~~~~~~
                      switchState

exit status 1

Compilation error: 'prevSwitchState' was not declared in this scope

I think you missed a line. But I don't have the book.

You can add int prevSwitchState = 1; after int switchState = 0;.

Welcome to the forum

Change

int switchState = 0;

to

int switchState = 0;
int prevSwitchState = 0;

That piece of code worked, but apparently i didn't declare "switchState".

The error referred to prevSwitchState, not to switchState.

By the way, thanks for using code tags in your first post, for the code as well as the errors.

The sketches for the Starter Kit are all available in the IDE examples and #11 includes these lines

// variable to hold the value of the switch pin
int switchState = 0;

// variable to hold previous value of the switch pin
int prevSwitchState = 0;

@sashaparadox Welcome to the forum.

Unlike many(most) first time posters, you have made a perfect post using code tags and posting the complete error message. Well done.

As @UKHeliBob says, the Starter Kit codes are available in the IDE with
File>Examples>10.StarterKit_BasicKit and there is no need to type the example codes into the IDE.