English subtitles

← Median - Intro to Computer Science

Get Embed Code
7 Languages

Showing Revision 6 created 05/25/2016 by Udacity Robot.

  1. For question 3, your goal is to define a procedure called median,
  2. that takes three numbers as its inputs,
  3. and outputs the median, which is the middle value, of those three numbers.
  4. Here are a few examples--
  5. If the three inputs are 1, 2, and 3--
  6. your procedure should output 2--
  7. if the three inputs are 9, 3, and 6--
  8. your output should be 6, since 3 is lower than 6--
  9. but 6 is lower than 9--
  10. and if the three inputs are 7, 8, and 7--
  11. well, then the median is 7.
  12. This is a pretty tough question, so I am going to give it 1 gold star.