D- Computer QuestionsExam 1

D- Computer QuestionsExam 1 - Computer Question 1: Plot and...

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

View Full Document Right Arrow Icon
Computer Question 1: Plot and Subplot Write Matlab code that displays the following four graphs next to each other (in one figure) as seen below. Let x contain 100 evenly spaced points, running from 0 to 10. Title and label both the x and y axes of your graph. a) y = x 2 b) y = x 3 c) y = (x- 5) 3 d) y = x Computer Question 2: Paychecks You must calculate the salary for an employee. First, prompt the user to enter the name of the employee. Then, prompt the user to enter the number of hours worked this week. Then display (using fprintf) the following: “The employee, named ___, earned ____ dollars” (obviously, fill in the blanks) Workers are paid $30 an hour for the first 40 hours. They are then paid 50% more, or $45, for overtime (all hours worked in excess of 40 hours) each week. If the user enters a negative number for the number of hours worked, your program should instead display “Error- Negative Hours.” If the user enters a number greater than 120, your program should instead display “Violation of Fair
Background image of page 1

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

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

Page1 / 2

D- Computer QuestionsExam 1 - Computer Question 1: Plot and...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online