D- Computer QuestionsExam 1

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

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

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/29/2012 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.

### 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
Ask a homework question - tutors are online