Arduino circuit 7

Here’s my code for the second circuit:

int OnSwitch = 2;
int OffSwitch = 3;
int LEDPin = 4;
boolean onoff = false;

void setup()
{
pinMode(OnSwitch, INPUT);
pinMode(OffSwitch, INPUT);
pinMode(LEDPin, OUTPUT);
}

void loop()
{
if(digitalRead(OnSwitch)==LOW)
{
onoff = true;
digitalWrite(LEDPin, HIGH);
}
else if(digitalRead(OffSwitch)==LOW)
{
onoff = false;
digitalWrite(LEDPin, LOW);
}

if(onoff == true)
{
digitalWrite(LEDPin, HIGH);
}
if(onoff == false)
{
digitalWrite(LEDPin, LOW);
}
}