E- Written Questions- Solutions and RubricExam 1

E- Written Questions- Solutions and RubricExam 1 -...

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

View Full Document Right Arrow Icon
14:440:127, Fall 2008 Exam 1 Version E “No Computer” Question 1: Answer whether the following questions evaluate to True or False : Let x = 15, y = 93, and z = -5 a) z+5 > 0 FALSE (it is 0) b) rem(y,x) > 3 FALSE (it is 3) c) rem(x,y) > 3 TRUE (it’s 15) d) ~x FALSE e) 16<=x<=20 TRUE (Matlab calculates the first two operands first, and 0<=20 is true, as discussed in class) f) ceil(y/x) == 6 FALSE (7) g) x ~= x | ( (y/z) > (x/z) ) FALSE Subtract 1 point for each incorrect answer. No partial credit is given for this question. “No Computer” Question 2: Identify the two errors in the following code segment (you can rewrite the incorrect statement in your blue book and circle what’s wrong), and then rewrite the code so that it will run correctly. fprintf(‘here is a number: %f and here is a word: ‘%s’. Goodbye ’, 52, flower) ERROR 1: '%s' should be ''%s'' (two single quotes on each side) ERROR 2: flower should either be ‘flower’, or you needed to define the variable flower
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 / 3

E- Written Questions- Solutions and RubricExam 1 -...

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