TEST CASE #1: If the starting floor is 1 and destination floor is 5, Program will display: "2" "3" "4" "now in level 5"

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
icon
Related questions
Question

Using C++, please use Selection Statements, Pointers, Functions and OOP only.

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"
Transcribed Image Text: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"
PROBLEM: Consider the elevator in the Faculty of Engineering (5 storex). 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:
Elevator
- noLevels: int
+ Elevator(int _levels)
+goUp(int from, int to): void
+ goDown(int from, int to): void
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:
o Program will display the floors which the elevator passes through, and finally the
destination floor.
O
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.
o
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
Transcribed Image Text:PROBLEM: Consider the elevator in the Faculty of Engineering (5 storex). 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: Elevator - noLevels: int + Elevator(int _levels) +goUp(int from, int to): void + goDown(int from, int to): void 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: o Program will display the floors which the elevator passes through, and finally the destination floor. O 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. o 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
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
JQuery and Javascript
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education