Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA OBJECT ORIENTED: Been struggling with this problem for almost a week now. It's going to be implemented into a LinkedNodesList I can send you
JAVA OBJECT ORIENTED:
Been struggling with this problem for almost a week now.
It's going to be implemented into a LinkedNodesList
I can send you the code needed once I am able to add comments.
Thank you in advance.
In this assignment, you will implement a simulation of an elevator that serves a building that has 5 floors. Each floor has a random number of passengers [0-5] When the elevator starts, it will start from floor 1 and goes up. The elevator stops and opens its door to get passengers in only if there is at least one passenger on the floor or if it's checking out a passenger to the requested floor. Otherwise the elevator keeps moving. The elevator goes up to the fifth floor and then goes down to the first floor. By the end of the trip, the elevator should serve all the people who requested the service Follows a breakdown of the simulation program 1. Initialize building: First, you need to initialize the five floors. Each floor has a random number of passengers. Each passenger is requesting to go to another floor (other than the floor she is currently in) (A) The number of passengers on each floor is a random number [0-5] (see 1 in Figure1) (B) Passenger: Every passenger object has the following properties (a) (b) (c) Passenger ID: This is an integer that starts from 1 and increment by one when every new object is instantiated Floor: This is the current floor the passenger is currently in (see 3 in Figure1) Destination Floor: This is the floor the passenger is going to. (see 4 in Figure1). Note that a destination floor is a random number but at the same time this number can not be the same number as the current floor. 2. Print Building Status: In this function, you need to print out the building status as shown in Figure1 3. Start Elevator: In this function, the elevator will start moving from the first floor. While the elevator is moving you need to print out every stop of the elevator and how many passengers left/ get in the elevator (A) Starting from floor 1. The elevator picks all passengers on the first floor. You need to add the passenger objects to the elevator and also print out the current transaction (see 1 and 2 in Figure2) (B) You need to print the elevator movement direction. Up or down. (see 3 in Figure2) (C) If there is no passenger in the elevator is going to a certain floor AND there is also no passengers waiting on that floor then the elevator should keep moving For example, no passenger is going to floor 2 and no passenger is waiting so elevator should keep moving the third floor (see 4 in Figure2) (D) After reaching the fifth floor the elevator goes down. As you can see the elevator does not pick new passengers. Only serving current passengers in the elevator (see Figure3) (E) Note that when the elevator reaches back the first floor the number of passengers in the elevator should ALWAYS be equal to zero. (see Figure3) In this assignment, you will implement a simulation of an elevator that serves a building that has 5 floors. Each floor has a random number of passengers [0-5] When the elevator starts, it will start from floor 1 and goes up. The elevator stops and opens its door to get passengers in only if there is at least one passenger on the floor or if it's checking out a passenger to the requested floor. Otherwise the elevator keeps moving. The elevator goes up to the fifth floor and then goes down to the first floor. By the end of the trip, the elevator should serve all the people who requested the service Follows a breakdown of the simulation program 1. Initialize building: First, you need to initialize the five floors. Each floor has a random number of passengers. Each passenger is requesting to go to another floor (other than the floor she is currently in) (A) The number of passengers on each floor is a random number [0-5] (see 1 in Figure1) (B) Passenger: Every passenger object has the following properties (a) (b) (c) Passenger ID: This is an integer that starts from 1 and increment by one when every new object is instantiated Floor: This is the current floor the passenger is currently in (see 3 in Figure1) Destination Floor: This is the floor the passenger is going to. (see 4 in Figure1). Note that a destination floor is a random number but at the same time this number can not be the same number as the current floor. 2. Print Building Status: In this function, you need to print out the building status as shown in Figure1 3. Start Elevator: In this function, the elevator will start moving from the first floor. While the elevator is moving you need to print out every stop of the elevator and how many passengers left/ get in the elevator (A) Starting from floor 1. The elevator picks all passengers on the first floor. You need to add the passenger objects to the elevator and also print out the current transaction (see 1 and 2 in Figure2) (B) You need to print the elevator movement direction. Up or down. (see 3 in Figure2) (C) If there is no passenger in the elevator is going to a certain floor AND there is also no passengers waiting on that floor then the elevator should keep moving For example, no passenger is going to floor 2 and no passenger is waiting so elevator should keep moving the third floor (see 4 in Figure2) (D) After reaching the fifth floor the elevator goes down. As you can see the elevator does not pick new passengers. Only serving current passengers in the elevator (see Figure3) (E) Note that when the elevator reaches back the first floor the number of passengers in the elevator should ALWAYS be equal to zero. (see Figure3)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started