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”
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education