# good - %Joseph Vallillo % Recitation 10 clear;clc client=0;...

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %Joseph Vallillo % Recitation 10 clear;clc client=0; total=0; stop=1; while stop % Initial Menu enter=menu('Enter Option:','User','Administrator','Quit Program'); % Lot Menu if (enter==1) lot=menu('Select the lot that you parked in:','A','B','C','P3','P4','L6'); % Input and calculate for Lot A, B, or C if (lot==1||lot==2||lot==3) disp('How long have you parked for?:') week = input('Weeks:'); day = input('Days (0-6):'); while (day&gt;6||day&lt;0) disp(' ') disp('Enters days between 0-6.') day = input('Days (0-6):'); end hour = input('Hours (0-23):'); while (hour&gt;23||hour&lt;0) disp(' ') disp('Enters hours between 0-23.') hour = input('Hours (0-23):'); end minute = input('Minutes (0-59):'); while (minute&gt;59||minute&lt;0) disp(' ') disp('Enters minutes between 0-59.') minute = input('Minutes (0-59):'); end %Calculate cost for A,B,C weeks=fix(week)*231;days=fix(day)*33;hours=fix(hour); if (hour&gt;5) cost=weeks+days+33;client=client+1;total=total+cost; fprintf('Bill amount: \$ %.2f\n',cost) elseif (hour&lt;=5&amp;&amp;hour&gt;0) if minute&gt;0 cost=weeks+days+ (hours*6)+3;client=client+1;total=total+cost; fprintf('Bill amount: \$ %.2f\n',cost) elseif minute==0 cost=weeks+days+(hours*6);client=client+1;total=total+cost; fprintf('Bill amount: \$ %.2f\n',cost) end elseif (hour==0) if (minute&lt;=30) cost=weeks+days+3;client=client+1;total=total+cost;...
View Full Document

## This note was uploaded on 10/27/2011 for the course BIO 101 taught by Professor Martin during the Spring '08 term at Rutgers.

### Page1 / 4

good - %Joseph Vallillo % Recitation 10 clear;clc client=0;...

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

View Full Document
Ask a homework question - tutors are online