rect10_vallillo_PROJ01

# rect10_vallillo_PROJ01 - %Code for parking receipt...

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

%Code for parking receipt clear;clc; disp( 'Please use whole numbers while answering the questions, do not use decimals, round up to the nearest incriment spcified (if you were parked for 15 minutes and it charges by 30 minute intervals, round up to 30 minutes). Also enter words as specified: if it say enter yes or no, do NOT enter Yes or No.\n' ) type=input( 'Enter 1 for short term parking, 2 for daily parking in P3, 3 for daily parking in P4, or 4 for economy long term parking.\n' ); switch type % Short term parking code case 1 disp( 'Short term parking costs 3.00\$ for each half hour, up to a maximum of 33.00\$ for an entire day. If you stayed for 5 hours and 30 minutes or longer please input that you stayed a full day.' ) time=input( 'Did you stay for more than 5 hours and 30 minutes? (If you stayed 5 hours and 30 minutes or longer you are charged for an entire day). Enter: yes or no\n' , 's' ); switch time case 'no' hour=input( 'How many 30 minute increments did you stay?\n' ); if hour>=11 disp( 'If you stayed for 5 hours and 30 minutes or longer you are charged for an entire day, please go back and follow directions.' ) elseif hour<11 cost=(hour)*3.00; fprintf( 'You owe %.001f dollars. Thank you.\n' ,cost) end case 'yes' day=input( 'How many days did you stay?\n' ); hour=input( 'How many 30 minute increments were you parked on your final day? (must be less than 5 hours and 30 minutes or it is concidered another day. If you stayed for less than 1 day but longer than 5 hours and

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.

## 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_PROJ01 - %Code for parking receipt...

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

View Full Document
Ask a homework question - tutors are online