Question
In some Asian countries, the number 14 is considered unlucky. Some building owners play it safe and skip both the 13th and the 14th floor
In some Asian countries, the number 14 is considered unlucky. Some building owners play it safe and skip both the 13th and the 14th floor in their numbering (i.e., the physical 13th & 14th floors are renamed the 15th & 16th floors).
Write an algorithm and create a flow chart for an elevator that takes users to their regular floors unless it is the 13th or 14th floor. In that case, take them to the 15th floor.
Now write your Java code method based on your flow chart
Should take the requested floor as a parameter
Should return the actual physical floor the elevator stops at
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