Question: Please show input and output code clearly! Thank you! Lab 5- Garage (in class) CSCI 251 Problem Statement A parking garage charges a $2.00 minimum

Please show input and output code clearly! Thank you!

Please show input and output code clearly! Thank you! Lab 5- Garage

(in class) CSCI 251 Problem Statement A parking garage charges a $2.00

Lab 5- Garage (in class) CSCI 251 Problem Statement A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any 24-hour period is $10.00. This garage does not allow parking for longer than 24 hours at a time Write a function garage yourLastName to calculate the parking charges for each customer. Also write how this function would be called in your main program garageTest yourLastName.m Input Data Parking hours Output Data Total charge Before You Begin 1. Start MATLAB (Start> All Programs> MATLAB R2013a) and change your Current Folder to the location of your hard drive (e.g., KJMATLAB programs/) If you forget to do this, your MATLAB programs will not be accessible whenever the computers in this lab are cleared, which is throughout the semester 2. In the Command Window, type edit garage yourLastName.m MATLAB should prompt that the file does not currently exist, select OK so MATLAB will create the file in your Current Folder Starting File Include header comments (i.e., at the beginning of your file) formatted as show below. Your electronic submission of the program file will represent your endorsement of the Honor Code Statement. % Course: CSCI 251, Section X % Student Name: Jane Doe % Student ID: 12345678 %Lab 5 in class % Due Date: % In keeping with the Honor Code of UM. I have neither % given nor received assistance from anyone other than the instructor % Program Algorithm 1. Write the function header, remember the function name must match name of the m-filel 2. The function garage takes in one parameter, parkingHours. And after calculation, it returris one result, totalCharge. 3. Create another file garageTest yourLastName.m (this is the main program used to test the garage function). 4. Include the header comments and clear the windows 5. In this program, use input to read in the customers name and parking time 6. While the parking time is less than or equal to 24 hours, call the garage function to return the total charge and then use fprintf to print out customer's name and total charge

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!