B- Written Questions- Solutions and RubricExam 1

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

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

14:440:127, Fall 2008 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) -3 for two major syntax errors -5 if the conditions are wrong, but the overall structure is correct -6 if the if statement is totally wrong, but they include either an if or a disp command -7 if left blank

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.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern