Ask Question
20 May, 21:09

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. 20 May, 21:24
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers