unit = input('Enter a unit of measure: ','s');
n = input('Enter a number: ');
switch(unit)
  case 'miles',
     c = [1 8 8*40 8*40*5.5 8*40*5.5*3 8*40*5.5*3*12];
  case 'furlongs',
     c = [1/8 1 40 40*5.5 40*5.5*3 40*5.5*3*12];
  case 'rods',
     c = [1/(8*40) 1/40 1 5.5 5.5*3 5.5*3*12];
  case 'yards',
     c = [1/(8*40*5.5) 1/(40*5.5) 1/5.5 1 3 3*12];
  case 'feet',
     c = [1/(8*40*5.5*3) 1/(40*5.5*3) 1/(5.5*3) 1/3 1 12];
  otherwise,
     c = [1/(8*40*5.5*3*12) 1/(40*5.5*3*12) 1/(5.5*3*12) 1/(3*12) 1/12 1];
end;
fprintf('%f miles or %f furlongs or %f rods or %f yards or %f feet or %f inches\n', n*c);

