Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started