Cant understand whats wrong with my code

Im on what should be the final stage of my code for my keypad with a password.

Here is my code

#include <Password.h>
#include <Keypad.h>
const int R1 = 1;
const int R2 = 2;
const int R3 = 3;
const int R4 = 4;
const int R5 = 5;
const int R6 = 6;
const int R7 = 7;
const int R8 = 8;
const int spkr = 9;
const int green = 10;
const int red = 11;
int keypressed;

Password password = Password("5409");

const byte Rows = 4;
const byte Cols = 4;

char keymap[Rows][Cols] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'#', '0', '*', 'D'}
};

byte rowPins[Rows] = {9, 8, 7, 6};
byte colPins[Cols] = {5, 4, 3, 2};

Keypad keypad = Keypad(makeKeymap(keymap), rowPins, colPins, Rows, Cols);

void setup() {
  Serial.begin(9600);
  pinMode (R1, OUTPUT);
  pinMode (R2, OUTPUT);
  pinMode (R3, OUTPUT);
  pinMode (R4, OUTPUT);
  pinMode (R5, OUTPUT);
  pinMode (R6, OUTPUT);
  pinMode (R7, OUTPUT);
  pinMode (R8, OUTPUT);
  pinMode (spkr, OUTPUT);
  pinMode (green, OUTPUT);
  pinMode (red, OUTPUT);
}
void loop() {
  keypad.getKey();
}

void keypadEvent(KeypadEvent eKey) {
  switch (keypad.getState()) {
    case PRESSED:
      Serial.print("Pressed: ");
      Serial.println(eKey);
      switch (eKey) {
        case '*': checkPassword(); break;
        case '#': password.reset(); break;
        default: password.append(eKey);
      }
  }
}

void checkPassword() {
  if (password.evaluate() {
    Serial.println("Success");
  } else {
    Serial.println("Wrong");
  }
}

void PassEvaluate() {
  if (Serial.println("Success") {
  tone(spkr, 500, 200);
    delay(500);
    tone(spkr, 400, 100);
    delay(200);
    tone(spkr, 750, 225);
    delay(300);
    tone(spkr, 450, 225);
    delay(500);
    tone(spkr, 400, 200);
    delay(500);
    tone(spkr, 450, 200);
    delay(300);
    tone(spkr, 600, 300);
    delay(300);
    tone(spkr, 400, 200);
    delay(200);
    tone(spkr, 700, 300);
    delay(300);
    tone(spkr, 700, 300);
    delay(100);
    tone(spkr, 600, 300);
    delay(300);
    tone(spkr, 400, 200);
    delay(200);
    tone(spkr, 320, 200);
    delay(400);
    tone(spkr, 650, 200);
    delay(300);
    tone(spkr, 400, 200);
    delay(500);
    tone(spkr, 650, 200);
    delay(30);
    tone(spkr, 650, 200);
    delay(500);
    tone(spkr, 400, 200);
    delay(50);
    tone(spkr, 400, 200);
    delay(500);
    tone(spkr, 400, 200);
    delay(1000);
    tone(spkr, 400, 200);
    delay(500);
    tone(spkr, 400, 200);
    delay(500);
    tone(spkr, 600, 300);
    delay(50);
    tone(spkr, 600, 300);
    delay(500);
    tone(spkr, 800, 300);
    delay(500);
    tone(spkr, 800, 300);
    delay(500);
    tone(spkr, 400, 200);
    tone(spkr, 800, 200);
    delay(500);
    tone(spkr, 400, 200);
    delay(100);
    tone(spkr, 400, 200);
    delay(500);
    tone(spkr, 300, 150);
    delay(500);
    tone(spkr, 500, 150);
    delay(500);
    tone(spkr, 300, 150);
    delay(500);
    tone(spkr, 300, 150);
    delay(500);
    tone(spkr, 300, 150);
    tone(spkr, 300, 150);
    tone(spkr, 470, 150);
    tone(spkr, 300, 150);
   
    digitalWrite (green, HIGH);
  }

}  else {
  digitalWrite (red, HIGH)

  tone(spkr, 200, 100);
  delay(100);
  tone(spkr, 400, 100);
}

and im getting these errors

 In function 'void checkPassword()':
 error: expected ')' before '{' token
 error: expected primary-expression before '}' token
error: expected ';' before '}' token
In function 'void PassEvaluate()':
error: expected ')' before '{' token
error: expected primary-expression before '}' token
error: expected ';' before '}' token
At global scope:
error: expected unqualified-id before 'else'
expected ')' before '{' token

Thank you for the help in advance

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

 if (password.evaluate() {

You are missing a ')' in there.

I just tried that but now im getting a different error

error: expected initializer before ')' token
expected initializer before ')' token

Use to format your code.
Attach your ‘complete’ sketch between code tags, use the </> icon in the posting menu.
[code]Paste your sketch here[/code]

BTW
delay() stops regular code execution for the delay interval.

You can replace delay() with a technique called Blink Without Delay, BWD.

When using BWD, your sketch can run other code during the delay time.

Read Robin2’s discussion:

1burnslia1:
I just tried that but now im getting a different error

error: expected initializer before ')' token
expected initializer before ')' token

So, post your updated code.

In code tags this time.

if (Serial.println("Success") {

You should be able to find these yourself.

Millennial ?

error: expected initializer before ')' token
expected initializer before ')' token

Even without delays I still get the same errors so I dont think the delay's were effecting my code in this case

if (Serial.println("Success") {

You should be able to find these yourself.

1burnslia1:

error: expected initializer before ')' token

expected initializer before ')' token




Even without delays I still get the same errors so I dont think the delay's were effecting my code in this case

Then you haven't found the missing semi-colon. Let's add that, format properly (one semi-colon per line) and repost so we can see what else you may have wrong.

error: expected initializer before ‘)’ token

means you are missing a punctuation mark.

every ( needs a corresponding )
every { needs a corresponding }
every [ needs a corresponding ]

the IDE will tell you where you erred. sometimes it will tell you the error is in a line way up high in the code that worked fine when you started. that is not a retroactive error. that is an early line of code that called some function you just changed

Read “How To Use This Forum”

This is what happens when you do not

1burnslia1:
Even without delays I still get the same errors so I dont think the delay's were effecting my code in this case

sp. "affecting"

We're still waiting to see the code