B- Written Questions- Solutions and RubricExam 1

B- 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
Exam 1 Version B “No Computer” Question 1: Answer whether the following questions evaluate to True or False : Let x = 41 and y = 83 a) y == 83 TRUE b) rem(y,x) > 1 FALSE (it is 1) c) rem(x,y) > 1 TRUE (it is 41) d) y>x & x>y FALSE e) length(factor(x))>40 FALSE (it is 1) f) x==y | exp(x) TRUE (the second part is true) g) x ~= y TRUE Subtract 1 point for each incorrect answer. No partial credit is given for this question. “No Computer” Question 2: Write an If Statement that does the following. A) Displays “X Greater” if x is greater than y B) Displays “Y Greater” if y is greater than x C) Displays “Equal” if x and y are equal You may assume that x and y have already been defined. if(x>y) disp(‘X Greater’) elseif(y>x) disp(‘Y Greater’) else disp(‘Equal’) end -1 for only minor syntax errors (i.e. the quotes are missing in disp) -2 for one major syntax error (i.e. the else is written where an elseif should be)
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.

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 / 3

B- 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