rect10_vallillo_Proj02

rect10_vallillo_Proj02 - %Joseph Vallillo % Recitation 10...

Info iconThis preview shows pages 1–3. 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 disp('Enter Options') disp('-------------') disp('1 - User') disp('2 - Administrator') disp('0 - Quit') disp(' ') enter=input('Enter Option:','s'); if (strcmpi(enter,'0'))||(strcmpi(enter,'1'))||(strcmpi(enter,'2')) % Lot Menu if (strcmpi(enter,'1')) clc disp(' ') disp('Menu Options') disp('------------') disp('Short Term Parking: A, B or C') disp('Daily: P3 or P4') disp('Economy Long Term Parking: L6') disp(' ') lot = input('Where did you park :','s'); disp(' ') % Input and calculate for Lot A, B, or C if (strcmpi(lot,'A') || strcmpi(lot,'a') || strcmpi(lot,'B') || strcmpi(lot,'b') || strcmpi(lot,'C') || strcmpi(lot,'c')) clc 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) disp(' ') 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) disp(' ') elseif minute==0 cost=weeks+days+ (hours*6);client=client+1;total=total+cost; fprintf('Bill amount: $ %.2f\n',cost) disp(' ') 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)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 / 6

rect10_vallillo_Proj02 - %Joseph Vallillo % Recitation 10...

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

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