distance_forloop - mode = 'Bicycle'; elseif (distance...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
clear clc c % added 2/15/2011 in class for j = 1:3 name = input('What is your name? ','s'); dist = input ('What is the distance that needs to be covered in feet? '); distance = distdim(dist, 'feet', 'miles'); miles = distance if distance <= 2 mode = 'Walk'; elseif (distance > 2) && (distance <= 10);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mode = 'Bicycle'; elseif (distance &gt; 10) &amp;&amp; (distance &lt;= 30); mode = 'ride MARTA'; else mode = 'take a plane on Delta Airlines'; end end fprintf('%s, you have %.2f miles to go.\nYou should %s.\n'. .. , name, miles, mode) disp (mode) % added 2/15/2011 in class...
View Full Document

Ask a homework question - tutors are online