Lab 2 - Engineering 7 Introduction to Programming for...

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

Engineering 7: Prof. Alexandre Bayen Introduction to Programming for Engineers Spring 2011 Lab 2: Branching Date Assigned: 5:00pm, Friday – Feb 4. Date Due: 5:00pm, Friday – Feb 11. Problem 1: Do Problem 4.1 in the Reader. Problem 2: Do Problem 4.2 in the Reader. Problem 3: Do Problem 4.3 in the Reader. Problem 4: Do Problem 4.4 in the Reader. Problem 5: Do Problem 4.6 in the Reader. Test Cases: >> grade = myLetterGrader(97) grade = A+ >> grade = myLetterGrader(84) grade = B Problem 6: Do Problem 4.7 in the Reader. Test Cases: >> response = myNukeAlarm(94,96,90) response = normal >> response = myNukeAlarm(94,96,80) response = alarm! Problem 7: Do Problem 4.8 in the Reader. Test Cases: >> [nRoots, r] = myNRoots(1,0,-9) nRoots = 2 r = 3 -3 >> [nRoots, r] = myNRoots(3,4,5) nRoots = -2 r = -0.6667 + 1.1055i -0.6667 - 1.1055i >> [nRoots, r] = myNRoots(2,4,2) nRoots = 1 r = 0 -1

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

View Full Document
Engineering 7: Prof. Alexandre Bayen Introduction to Programming for Engineers Spring 2011 Problem 8: Write a function with header
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

Lab 2 - Engineering 7 Introduction to Programming for...

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

View Full Document
Ask a homework question - tutors are online