Posts

Showing posts from December, 2017

CSC104 SLOG Week 9

What advice would you give to a student beginning this course about (a) how to design a function, and (b) how to prepare for this course? My advice to a student beginning this course about how to design a function is to first describe what the function will do.  This can be achieved by writing a function contract, for example function-name: number -> number.  In addition, writing a full-design check-expect is helpful because we can start with our output value, and work backwards to recreate that output.  We can then substitute check-expect with define and each variable with a parameter.  Depending on what the function is intended to do, it may be necessary to think about special cases and recursion.  To illustrate, in the Fibonacci sequence, the first and second terms are both 1.  Therefore, when a defining a function to compute the Fibonacci sequence, we will need to include the special case of n < 2 in our function design.  Likewise, we can use the power of recursion to call

CSC104 SLOG Week 8

What's something new you learned this week in class? In class, we explored binary notation.  In particular, we learned how to express numbers in binary and add and multiply binary terms.  This is a topic that I have been interested in learning more about since the beginning of the course. What was one of your achievements this week? One of my achievements this week was completing Project 2.  I found this project very interesting and was pleased to see that I was able to apply some of the course material.  Overall, my group members and I understood the requirements and we were able to work through the project fairly quickly.  However, upon testing our functions, one test occasionally kept failing.  To get help, I visited the discussion board on Piazza, and discovered that there was an error in the original check-expect provided in the project.  The instructor posted the correct check-expect, and from that we were able to pass all of the tests.