Question: A computer game to ascend a building with a specified number of floors. You have three different facilities for each floor to reach the top:
A computer game to ascend a building with a specified number of floors. You have three different facilities for each floor to reach the top: the elevator the escalator and walking up the stairs
Each facility has its own scoring rule. Assume the initial score is zero.
Elevator : Score increments to the next even number.
Escalator : Score increments to the next odd number.
Walk : Score increments to the next prime number.
Write an algorithm and python code to display the score to ascend a building. Difficult
Example: If number of floors and person chosen for first floor, for second floor, for third floor and for fourth floor. The score is first prime numberfirst odd numbernext prime numbernext odd number
Inputs:
Number of floors n
Enter facility number or or ntimes
Output:
Score
Test cases:
Test :
Input
Expected output numbers
Test :
Input
Expected output numbers
Test :
Input
Expected output numbers
Test :
Input
Expected output numbers
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
