project 1 - elseif(3.5>=x)(x>3)...

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

View Full Document Right Arrow Icon
%% Short term parking x= input('enter how many hours parked rounded up to the half hour:'); if(x<=.5) disp('parking costs $3'); elseif(1>=x)(x>.5) disp('parking costs $6'); elseif(1.5>=x)(x>1) disp('parking costs $9'); elseif(2>=x)(x>1.5) disp('parking costs $12'); elseif(2.5>=x)(x>2) disp('parking costs $15'); elseif(3>=x)(x>2.5) disp('parking costs $18');
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(3.5&gt;=x)(x&gt;3) disp('parking costs $21'); elseif(4&gt;=x)(x&gt;3.5) disp('parking costs $24'); elseif(4.5&gt;=x)(x&gt;4) disp('parking costs $27'); elseif(5&gt;=x)(x&gt;4.5) disp('parking costs $30'); elseif(5.5&gt;=x)(x&gt;5) disp('parking costs $33'); elseif(24&gt;x)(x&gt;5.5) disp('parking costs $33'); end...
View Full Document

Ask a homework question - tutors are online