Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using MatLab Youve decided to take a well-deserved break from school and travel to an exotic foreign destination! Youve chosen to fly out of Denver

Using MatLab

Youve decided to take a well-deserved break from school and travel to an exotic foreign destination! Youve chosen to fly out of Denver International Airport (DIA) and are deciding whether it is cheaper to take a shuttle down to DIA from CSU or park your vehicle at DIA for the length of your trip. The cost to park at DIA depends on the lot you select and how long you plan to park. Consider the cost of a roundtrip Green Rides shuttle to and from Denver International Airport as well as the garage and economy parking lot rates. Green Ride Roundtrip shuttle To and From DIA Departs from CSU Transit Center $28.00 one way $56.00 roundtrip Garage Parking $3 per hour Daily maximum of $ 24.00 per day Economy Parking $5 per hour Daily maximum of $ 20.00 per day

1. Write a MATLAB function that calculates the cost of your parking choices at DIA and compares it to a roundtrip shuttle from Green Ride. Calculate this cost based on the number of weeks, days, and hours, you plan to park. The output to your program is the cheapest option. These are the inputs to your function. Complete your program and test it using the following scenarios:

A. Your trip that lasts 1 week, 2 days, and 10 hours.

B. Your trip that lasts 2 days, and 15 hours.

C. Your trip that lasts 4 days, and 8 hours.

D. Use the fprintf function to print formatted output comparing one of the parking lot costs with the Green Ride Shuttle cost

Hints: Using a flowchart, write out what the structure of your function will be. What input(s) will you use? What are the output(s) from this function? What equations will allow you to calculate the costs for parking in each lot? Program your function to ask the following: o Which lot approach you using? How can an if statement help you here? o How many weeks, days, and hours did you park? Assume once the hourly rate reaches the daily maximum, the daily maximum of that lot will be charged.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago