Ask Question
3 September, 17:03

The software for the elevator uses a variable, called level, to track the floor number of the elevator's current position. When a person presses a button indicating that the elevator should rise to a higher floor, the following goUp procedure is invoked with the desired number of floors to climb provided as a parameter.

What is displayed if the elevator is currently on the 3rd floor (level = 3) and the procedure goUp (3) is invoked?

+3
Answers (1)
  1. 3 September, 20:53
    0
    The elevator will display 6 that is level = 6.

    Explanation:

    The elevator is currently on the 3rd floor (level = 3). Whenever, the goUp procedure is called, the elevator climbed up based on the number provided as parameter to the goUp procedure.

    Since the elevator is already on the 3rd floor and goUp (3) is invoked, it means the elevator will climb to 3 additional floor, which is level 3 + 3 and that gives us level 6.

    So, the elevator will display level 6.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “The software for the elevator uses a variable, called level, to track the floor number of the elevator's current position. When a person ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers