Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Need help figuring out how to write the script for this problem.

Subject: Need help figuring out how to write the script for this problem.

From: Taylor

Date: 4 Nov, 2010 17:35:04

Message: 1 of 3

Most major airports have separate parking lots for long-term and short-term parking. The cost to park depends on the lot you select, and how long you stay. Consider this rate structure from the Salt Lake International Airport during the summer of 2008.

+ Long-Term (Economy) Parking
 --+ The first hour is $1.00, and each additional hour or fraction thereof is $1.00.
 --+ Daily maximum $6.00
 --+ Weekly maximum $42.00
+ Short-Term Parking
 --+ The first 30 minutes of parking are free and each additional 20 minutes or fraction thereof is $1.00
 --+ Daily maximum $25.00
Write a program that asks the user the following:
 --+ Which lot are you using?
 --+ How many weeks, days, hours, and minutes did you park?

Your program should then calculate the parking bill.

You must also include an error check using a conditional loop to ensure correct input for the lot type, i.e. 1 or 2. Use switch/case to determine the cost for the type lot entered. Print the input as well as the cost with appropriate labeling. Use fprintf for all output with appropriate labeling.

Subject: Need help figuring out how to write the script for this problem.

From: Sean

Date: 4 Nov, 2010 17:46:04

Message: 2 of 3

"Taylor " <tdb_28@yahoo.com> wrote in message <iauqs8$b4r$1@fred.mathworks.com>...
> Most major airports have separate parking lots for long-term and short-term parking. The cost to park depends on the lot you select, and how long you stay. Consider this rate structure from the Salt Lake International Airport during the summer of 2008.
>
> + Long-Term (Economy) Parking
> --+ The first hour is $1.00, and each additional hour or fraction thereof is $1.00.
> --+ Daily maximum $6.00
> --+ Weekly maximum $42.00
> + Short-Term Parking
> --+ The first 30 minutes of parking are free and each additional 20 minutes or fraction thereof is $1.00
> --+ Daily maximum $25.00
> Write a program that asks the user the following:
> --+ Which lot are you using?
> --+ How many weeks, days, hours, and minutes did you park?
>
> Your program should then calculate the parking bill.
>
> You must also include an error check using a conditional loop to ensure correct input for the lot type, i.e. 1 or 2. Use switch/case to determine the cost for the type lot entered. Print the input as well as the cost with appropriate labeling. Use fprintf for all output with appropriate labeling.



So if I write the function to do this, I get the A in your class right?

Subject: Need help figuring out how to write the script for this problem.

From: Steven_Lord

Date: 4 Nov, 2010 17:47:48

Message: 3 of 3



"Taylor " <tdb_28@yahoo.com> wrote in message
news:iauqs8$b4r$1@fred.mathworks.com...
> Most major airports have separate parking lots for long-term and
> short-term parking. The cost to park depends on the lot you select, and
> how long you stay. Consider this rate structure from the Salt Lake
> International Airport during the summer of 2008.

*snip*

Ask Ryan.

http://www.mathworks.com/matlabcentral/newsreader/view_thread/295428

Or perhaps you can help your professor with help for problem 8.32 in "MATLAB
for Engineers" by Holly Moore.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us