YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← The If Statement - Intro to Java Programming

Get Embed Code
7 Languages

Showing Revision 4 created 05/24/2016 by Udacity Robot.

  1. So your job was to adjust this program so that
  2. it works for that building, where both the 13th and
  3. 14th floor should be skipped in the elevator. So, that
  4. means that the numbers from 1 to 12, should stay
  5. unchanged. There won't ever be an input of 13 or
  6. 14. So that means 15 should get mapped to 13,
  7. 16 should become 14, 17, 15 and so on. That
  8. means if the floor number is 15 or greater, or in
  9. other words if it's greater than 14, then we want to subtract 2 and not 1.
  10. And those are the two changes that you
  11. need to make to the program and it'll work.