distance_whileloop

distance_whileloop - elseif (distance > 10) &&...

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

View Full Document Right Arrow Icon
% added 2/15/2011 in class % flag = 1; while flag == 1 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'); if distance <= 2 mode = 'Walk'; elseif (distance > 2) && (distance <= 10); mode = 'Bicycle';
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: elseif (distance > 10) && (distance <= 30); mode = 'ride MARTA'; else distance > 30; mode = 'take a plane on Delta Airlines'; end fprintf('%s, you have %.2f miles to go.\nYou should %s.\n'. .. , name, miles, mode) end e flag = input('Do you want to do it again 0(no) 1(yes)? ') ;...
View Full Document

This note was uploaded on 05/01/2011 for the course HCSC 110 taught by Professor Amosjohnson during the Spring '11 term at Morehouse.

Ask a homework question - tutors are online