In C++ Language using Functions and Pointers PROBLEM: Consider the elevator in the Faculty of Engineering (5 storey). Write a program which accepts the floor number where a passenger (student/faculty/other personnel) will ride the elevator. The passenger can then input the target destination floor. SPECIFICATIONS: Implement the class diagram below: Inside the main method, create an instance of the class Elevator. Use the goUp or goDown methods to generate the program display. Passenger can ride in any floor (1,2,3,4 or 5). Program will prompt the user with the target destination floor. After the user input: Program will display the floors which the elevator passes through, and finally the destination floor. Elevator will not move if the input for destination floor is the same as the present floor. Program will notify the user and then terminate. Program will also terminate if the input destination is not 1,2,3,4 or 5. You’re free to format the input/output display. Observe proper code indention All lines should have a comment TEST CASE #1: If the starting floor is 1 and destination floor is 5, Program will display: “2” “3” “4” “now in level 5” TEST CASE #2: If the starting floor is 2 and destination floor is 2, Program will display: “start and destination floor is the same”
In C++ Language using Functions and Pointers PROBLEM: Consider the elevator in the Faculty of Engineering (5 storey). Write a program which accepts the floor number where a passenger (student/faculty/other personnel) will ride the elevator. The passenger can then input the target destination floor. SPECIFICATIONS: Implement the class diagram below: Inside the main method, create an instance of the class Elevator. Use the goUp or goDown methods to generate the program display. Passenger can ride in any floor (1,2,3,4 or 5). Program will prompt the user with the target destination floor. After the user input: Program will display the floors which the elevator passes through, and finally the destination floor. Elevator will not move if the input for destination floor is the same as the present floor. Program will notify the user and then terminate. Program will also terminate if the input destination is not 1,2,3,4 or 5. You’re free to format the input/output display. Observe proper code indention All lines should have a comment TEST CASE #1: If the starting floor is 1 and destination floor is 5, Program will display: “2” “3” “4” “now in level 5” TEST CASE #2: If the starting floor is 2 and destination floor is 2, Program will display: “start and destination floor is the same”
Chapter14: Introduction To Swing Components
Section: Chapter Questions
Problem 15RQ
Related questions
Question
In C++ Language using Functions and Pointers
PROBLEM: Consider the elevator in the Faculty of Engineering (5 storey). Write a
SPECIFICATIONS:
Implement the class diagram below:
- Inside the main method, create an instance of the class Elevator. Use the goUp or goDown methods to generate the program display.
Passenger can ride in any floor (1,2,3,4 or 5). - Program will prompt the user with the target destination floor. After the user input:
- Program will display the floors which the elevator passes through, and finally the destination floor.
- Elevator will not move if the input for destination floor is the same as the present floor. Program will notify the user and then terminate.
- Program will also terminate if the input destination is not 1,2,3,4 or 5.
- You’re free to format the input/output display.
- Observe proper code indention
- All lines should have a comment
TEST CASE #1:
If the starting floor is 1 and destination floor is 5,
Program will display:
“2”
“3”
“4”
“now in level 5”
TEST CASE #2:
If the starting floor is 2 and destination floor is 2,
Program will display:
“start and destination floor is the same”
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage