project 1r - disp('parking costs $6');

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%% Akshay Patel RUid: 131006876 %% 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'); elseif(3.5>=x)(x>3); disp('parking costs $21'); elseif(4>=x)(x>3.5); disp('parking costs $24'); elseif(4.5>=x)(x>4); disp('parking costs $27'); elseif(5>=x)(x>4.5); disp('parking costs $30'); elseif(5.5>=x)(x>5); disp('parking costs $33'); elseif(24>x)(x>5.5); disp('parking costs $33'); end %% Daily Lot Parking p= input('lot number; 3 or 4:'); x= input('enter how many hours parked rounded up to the half hour:'); if(p==3)&(x disp('parking costs $3'); elseif(p==4) &(x disp('parking costs $3'); elseif(p==3)&(1>=x);(x>.5); disp('parking costs $6'); elseif(p==4) &(1>=x);(x>.5);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: disp('parking costs $6'); elseif(p==3)&amp;&amp;(1.5&gt;=x);(x&gt;1); disp('parking costs $9'); elseif(p==4)&amp;&amp;(1.5&gt;=x);(x&gt;1); disp('parking costs $9'); elseif(p==3)&amp;&amp;(2&gt;=x);(x&gt;1.5); disp('parking costs $12'); elseif(p==4)&amp;&amp;(2&gt;=x);(x&gt;1.5); disp('parking costs $12'); elseif(p==3)&amp;&amp;(2.5&gt;=x);(x&gt;2); disp('parking costs $15'); elseif(p==4)&amp;&amp;(2.5&gt;=x);(x&gt;2); disp('parking costs $15'); elseif(p==3)&amp;&amp;(3&gt;=x);(x&gt;2.5); disp('parking costs $18'); elseif(p==4)&amp;&amp;(3&gt;=x);(x&gt;2.5); disp('parking costs $18'); elseif(p==3)&amp;&amp;(3.5&gt;=x);(x&gt;3); disp('parking costs $21'); elseif(p==4)&amp;&amp;(3.5&gt;=x);(x&gt;3); disp('parking costs $21'); elseif(p==3)&amp;&amp;(x&gt;=4); disp('parking costs $24'); elseif(p==4)&amp;&amp;(x&gt;=4); disp('parking costs $27'); end %% Economy Long Term Parking Lot x=input ('How many hours parked up to 24 hours:'); z=(x-24); if (z&lt;=0) disp('Parking costs $18') else price=(ceil(z/8)*6)+18; fprintf('Parking costs $%.0f',price) end...
View Full Document

This note was uploaded on 03/24/2011 for the course ENGINEERIN 127 taught by Professor Finch during the Spring '08 term at Rutgers.

Page1 / 2

project 1r - disp('parking costs $6');

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online