switch case with pushbutton

I coudnt figure it out… pls help
using switch case with pushbutton…

code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 9, 8, 7);

const int buttonPin1 = 6;
const int buttonPin2 = 5;
const int buttonPin3 = 4;
const int buttonPin4 = 3;
const int ledPin = 13;

int prevButtonState1 = 0;
int prevButtonState2 = 0;
int prevButtonState3 = 0;
int prevButtonState4 = 0;

int buttonState = 0;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int buttonState4 = 0;

void setup(){

pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(buttonPin3, INPUT);
pinMode(buttonPin4, INPUT);
pinMode(relay, OUTPUT);
pinMode(pulsePin, INPUT);
pinMode(ledPin, OUTPUT);

Serial.begin(9600);
attachInterrupt(coinInt, coinInserted, RISING);

digitalWrite(pulsePin, HIGH);
digitalWrite(13, LOW);
digitalWrite(relay, LOW);
}

void loop(){

const int state = HIGH;

const int buttonState1 = digitalRead(buttonPin1);
const int buttonState2 = digitalRead(buttonPin2);
const int buttonState3 = digitalRead(buttonPin3);

switch (state){

case buttonState1:

lcd.clear();
lcd.begin(20, 4);
lcd.setCursor(0, 0);
lcd.print(“Please Insert Coin”);
lcd.setCursor(0, 1);
lcd.print(“Amount: P0”);
lcd.setCursor(0, 2);
lcd.print(“Duration: 00:00”);
prevButtonState1 = buttonState1;
process();
break;

case buttonState2:

lcd.clear();
lcd.begin(20, 4);
lcd.setCursor(0, 0);
lcd.print(“Please Insert Coin”);
lcd.setCursor(0, 1);
lcd.print(“Amount: P0”);
lcd.setCursor(0, 2);
lcd.print(“Duration: 00:00”);
prevButtonState1 = buttonState1;
break;

case buttonState3:

lcd.clear();
lcd.begin(20, 4);
lcd.setCursor(0, 0);
lcd.print(“Please Insert Coin”);
lcd.setCursor(0, 1);
lcd.print(“Amount: P0”);
lcd.setCursor(0, 2);
lcd.print(“Duration: 00:00”);
prevButtonState1 = buttonState1;
break;
}

What is the problem ?
Please edit your post and put code tags (</>) around the code.

One immediate problem

  const int buttonState1 = digitalRead(buttonPin1);
  const int buttonState2 = digitalRead(buttonPin2);
  const int buttonState3 = digitalRead(buttonPin3);

By their very nature the buttonStates cannot be consts

Problem 2
There are a number of variables not declared in the code

Problem 3
Auto Format the code and you will see that there is at least one missing brace at the end of the code.

  const int state = HIGH;

  const int buttonState1 = digitalRead(buttonPin1);
  const int buttonState2 = digitalRead(buttonPin2);
  const int buttonState3 = digitalRead(buttonPin3);

Those can't be constants; you will never be able to change them in your code.

[code]
  switch (state) {

    case buttonState1:
      ...
      ...

The case in a switch block needs to be a constant value, not a variable. It would be something like

 switch(buttonState1)
 {
    case LOW:
      ...
      ...
      break;
    case HIGH:
      ...
      ...
      break;
  }

This might not suite your needs.

I would start with a book on C (or a tutorial on the web).