Elevator Class
mediumQuestion 536Create a class Elevator with a public int field Floor (starts at 0). Add Up() which moves up one floor but never above 10, and Down() which moves down one floor but never below 0. Do not write a Main method.
After calling Up() three times the program prints the output shown in Expected Output.
Expected output
3= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
Classes
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cw, cr, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.