{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

rect10_vallillo_Proj0223

# rect10_vallillo_Proj0223 - %Joseph Vallillo Recitation 10...

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

%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) elseif (minute==0) cost=weeks+days;client=client+1;total=total+cost; fprintf('Bill amount: \$ %.2f\n',cost)

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.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern