PART III
To design a function, first define data types, which is called a contract in DrRacket. This will help you construct your thoughts on what the function does. Then, start by typing (define, write the header of the function. A placeholder is often used here. Following header is the body of a function, where the functional part of a function is written. Conditional statements or if statements are sometimes used to further specify what a function does under different situations. Before actually writing a function, check-expect statements can be useful in helping to design from sketch. Start by “expecting” the direct final result and then “expect” intermediate steps really helps to organize thoughts. After fully designing a function, click run on the top right corner and then try a couple of examples in the interaction plane to make sure no error is produced.
Key to preparing for this course is to keep up with the lecture materials. With having to prepare for the weekly quizzes, this should be a hard thing. Before writing a quiz, make sure to go over the exercise and lecture files from the week before. Usually exercise hand-outs are designed to help prepare for the quizzes, and if you understand everything in those hand-outs there’s a very good chance you can get a perfect mark on that quiz. Before exams, just memorize some useful functions, then read over all the lecture files and quiz-handouts again, and you’re good to go :).
CSC104 is one of the courses that I actually enjoyed a lot in UofT, and so far I’ve been getting decent marks. Hopefully the final exam goes well too.Â













