Need to create an elevator program in Netbeans using Java. The program needs to
ID: 3827303 • Letter: N
Question
Need to create an elevator program in Netbeans using Java. The program needs to reflect newer elevators where a user enters a floor number and one of the multiple elevators comes to pick them up and take them to the floor they entered. This is a very simple program, no need to worry about doors opening or closing or anything like that. There are 5 different parts to this project. The user gui, the admin gui, a web interface, a elevator class, and a control class. The requirements are as following 1. The system will include 2-6 elevators and 10-20 floors 2. The control object will command movement of each elevator 3. The user can request a floor from the user gui or web interface 4. A user can view the status of each elevator in the admin gui 5. A database will store the number of elevators and the number of floors. This data will not be available from anywhere else and should not be hardcoded.
Explanation / Answer
import java.awt.geom.*; public class elevator { static int floor = 0, choice1, person = 0; public static void main(String args[]) { floor = ((int) (Math.random() * 10 + 1)); System.out.println("The elevator is now on floor " +floor); System.out.print("Which floor are you at now (0-10) where 0 = basement: "); choice1 = Keyboard.readInt(); if(floor == choice1) { System.out.println("Enter the elevator"); } else if(floor > choice1) { ElevatorDown(); } else if(floor choice1) { ElevatorDown(); } else if(floor =floor; floor++) System.out.println(floor); System.out.println("The elevator has arrived"); } public static void ElevatorDown() { System.out.println("The elevator is on it's way down..."); for (person = choice1; choice1Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.