rect10_vallillo_Proj02

rect10_vallillo_Proj02 - %Joseph Vallillo % Recitation 10...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
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==1 % 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:'); while (week<0) disp(' ') disp('Enter weeks 0 or greater') week=input('Weeks:'); end day = input('Days (0-6):'); while (day>6||day<0) disp(' ') disp('Enters days between 0-6.') day = input('Days (0-6):'); end hour = input('Hours (0-23):'); while (hour>23||hour<0) disp(' ') disp('Enters hours between 0-23.') hour = input('Hours (0-23):'); end minute = input('Minutes (0-59):'); while (minute>59||minute<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>5) cost=weeks+days+33;client=client+1;total=total+cost; fprintf('Bill amount: $ %.2f\n',cost) elseif (hour<=5&&hour>0) if minute>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>0&&minute<=30) cost=weeks+days+3;client=client+1;total=total+cost; fprintf('Bill amount: $ %.2f\n',cost) elseif (minute>30) cost=weeks+days+6;client=client+1;total=total+cost; fprintf('Bill amount: $ %.2f\n',cost)fprintf('Bill amount: $ %....
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

rect10_vallillo_Proj02 - %Joseph Vallillo % Recitation 10...

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