How to design a function and how to prepare for the course

Good evening, it was a pleasure being in CSC104 for the semester. I learned a lot throughout the second half of the year.
First of all, I am going to talk about how to design a function. What is a function? Function is a named procedure that perform what you tell it to do. Function consists header and body. Header consists of the name of the function as well as other required elements. Body consists what you edit the function. I simply begin with a check-expect and then, I replace it with a function template. Finally, I need to test it and debug it until all tests are passed. For example, I want to write a function that when I say “cat-number 1 2”, I produces “3”. Apparently the cat-number is the name of the function and “3” is the result. Then, what should the header and body of the function be? The function template is
(define (header)
 (body))
Then my function should be
(define (cat-number a-number1 a-number2))
 (+a-number1 a-number2))
In this case, cat-number a-number1 a-number2 is the header of the function and +a-number1 a-number2 is the body of the function. Then, the function will be tested and debugged by myself and if all tests are passed, I’m succeeded.
            Secondly, I am going to discuss this preparation for this course. I strongly recommend students attend all lectures and do all of the assignments teacher let us to do. It’s useful!!! Students don’t have to buy the textbook. I also recommend students form a group of 3 or 4 throughout the semester and share the notes together and discuss about the lecture material weekly in order to get prepared for the lecture.

            At last, I would say wish the best luck of we all and I hope every students enjoyed the class like myself.

Comments

Popular posts from this blog

Diana's first blog

Mathematics