Ask Question
4 September, 09:51

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?

+4
Answers (1)
  1. 4 September, 10:20
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers