Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
The elevator starts on floor 1. Repeatedly ask which floor the user wants (integer). Move the elevator to that floor and print Now on floor X.
If the user enters 0, the building closes-exit the loop and print Elevator parked.
Assume floors are positive integers (you may re-prompt if they type a negative floor).
Skills: while, state variable for current floor.