Question: using only loop and not using any method in java Problem 1: [20 marks] Simulate the movement of an elevator (filename: Elevator.java) Design an algorithm
![1: [20 marks] Simulate the movement of an elevator (filename: Elevator.java) Design](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4efde582f0_22166f4efddef50e.jpg)
Problem 1: [20 marks] Simulate the movement of an elevator (filename: Elevator.java) Design an algorithm and then write a program called Elevator, which models a simplified elevator a) The elevator operates in a building with 9 floors. The labelling of the floors begins at 1. b) The user will request a floor by typing in an integer in the appropriate range. The elevator you are modelling needs to move to the requested floor, displaying floor numbers and a picture of an up/down arrow as it goes. c) The program should continue moving to new floors and prompting for a floor selection until the user enters a sentinel value of O instead of a floor number. When the sentinel value is entered, the program should exit. d) If the entered floor number is not valid, the user should be warned, and the user is asked to enter a floor number again. A sample runs is given below: 1 ---- 0.0 The elevator is at Floor 1 now Enter a floor number between 1 and 9 or enter 0 to quit: 5 The elevator is moving up from Floor 1 to 5 15 IA 0 - A 41 AM A 31 A DOW OO A 2 --- A 1 AN OO The elevator is at Floor 5 now Enter a floor number between 1 and 9, or enter 0 to quit: 12 Invalid floor number. Try again. Enter a floor number between 1 and 9 or enter to quit 3 The elevator is moving down from Floor 5 to 3 FIFIEI 31 The elevator is at Floor 3 Bow Enter a floor number between 1 and 9 or enter to quito Thank you for using the elevator program. Goodbye
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
