CS115W2009M2

18 marks boolean and conditional expressions a 7

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: 理,内容充实,简单易懂 具體詳細表 CS115 作業答疑,考試複習,有過去考試的卷子和過去所有作業準確答案,也有自出的題,價格面儀 CS116/136 普通作業答疑不收費,如果一對一輔導價格面議 CS134 擁有最全的資料,無論作業還是近四個 term 所有考試卷子(不包括 final),價格面儀 CS240 答疑解惑,不收費 CS241 答疑+Debug 需要請請吃飯 CS246 答疑解惑 免費 ,Debug 需要請吃飯 CS245/251 愛莫能助 CS341 答疑解惑 不收費 CS350 答疑解惑 + Debug 不收費 CS343 答疑解惑 + Debug 不收費 CS360 跟我討論問題,我請你吃飯 其他課程諸如 Math135/136/137/138,可以給你介紹好老師 想學 Flash 的同學也可以找我,不過價格會比 CS 課貴 想學唱歌的別找我,謝謝 喝酒的找我,隨時奉陪 Question 1. [ 18 marks ] Boolean and Conditional Expressions a) [ 7 marks ] Use the evaluation rules to perform a full trace the following Scheme program. You may need not all the lines. ( and ( < 3 4 ) ( or ( = 3 5 ) ( = 3 3 ) ( > 3 5 ) ) ) b) [ 3 marks ] The following conditional statement generates an error. Explain in a single sentence what the problem is. ( cond [ ( = 10 9 ) ( / 34 0 ) ] [(>18)(*23)] [ ( < 2 1 ) “ABC”] ) c) [ 4 marks ] Which pairs of the following predicates are equivalent( i.e. would produce the same values for all integer values of x ) ? Briefly justify your answer. A: ( define ( cond 1 x ) ( and ( < x 50 ) ( < 0 x ) ) ) B: ( define ( cond2 x ) ( cond [ ( &l...
View Full Document

This note was uploaded on 10/24/2009 for the course CS 115 taught by Professor Graham during the Fall '08 term at Waterloo.

Ask a homework question - tutors are online