{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

InLab03.pdf - In-Lab 3 If/Else Statements Switch/Case Menu...

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

View Full Document Right Arrow Icon
1 In-Lab 3: If/Else Statements, Switch/Case, Menu Directions For this assignment, you will create an m-file as your main script. The file must have the following naming convention: “ FirstName_LastName_InLab3.m ”. Make sure to do the following for full credit: Create separate cells for each problem Comment your code thoroughly Suppress all unnecessary output Store all answers as variables To submit multiple files at once, zip them all together in MATLAB and rename using the above convention. Add the following header to every file you submit: % Name % Date % Section # % Assignment (i.e. In-Lab 1) Instructor-Guided Portion (download InLab3.m from the Moodle page) 1. Use an if statement to calculate an employee’s weekly pay. The employee makes $15 per hour for the first 40 hours of work, and time-and-a-half per hour for any additional hours. Test your code with 35, 40, and 55 hours worked. 2. Use a switch/case statement to create a trip calculator that computes and displays the distance between Raleigh and a destination city. First, create a menu with the given cities as options. Then, use a switch/case
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}