Lab: Digital Input and Output with an Arduino

Everything goes well on example labs...

https://player.vimeo.com/video/460875772

Use two speakers to replace LEDs, the smaller one sounds in a low voice in the video, but it did make a clear voice.

https://player.vimeo.com/video/460875832

Lab: Analog In with an Arduino

https://player.vimeo.com/video/460875879

Question:

I didn't push the switch, but switch returned numbers were always "1"(that should means true)...

Out of labs

void loop() { // read the sensor on analog pin 0: 
int sensorValue = analogRead(A0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): 
float voltage = sensorValue * (5.0 / 1023.0); // print out the value you read: 
Serial.println(voltage);
}

Question:

I couldn't figure out what the number "1024" refers to, which is mentioned in Finding Your Sensor Range. And why do we use "1023" to calculate voltage instead of "1024"?