Friday, January 30, 2015

Week 1- 4: CSC 148 SLOG: My First Impression on CSC 148

During the first four weeks for CSC 148 class, I learnt many basic techniques about Python. One thing I learnt was how to use subclass. Using subclass was a new topic for me as I did not learn it during CSC 108 class. I also had some trouble with Lab exercises for the first two weeks. However, my TA explained the concept very well that I understood the concept at once. I would like to thank all the TA and senior lecturers in CSC 148 for their efforts.

For the first two weeks, we learnt about Object-oriented programming. We learnt how to use __init__ and how we can use privacy using underscore in Python.

For instance, I tried writing class Drink for __init__ only.
class Drink:
    """ Information about Drink on calories and amount
    """

    def __init__(self, calories, amount):
        """ (Drink, int, int) -> NoneType
     
        Initialize class Drink        
        """

        self.calories = calories
        self.amount = amount

I also tried making class Coke that has Drink for __init__ only.

class Coke(Drink):
    """ Information about Coke on calories, amount and the amount of caffeine it contains
    """

    def __init__(self, calories, amount, caffeine):
        """ (Drink, int, int, int) -> NoneType
     
        Initialize class Coke        
        """

        Drink.__init__(self, calories, amount)
        self.caffeine = caffeine


This demonstrates how well I understand the use of class and subclass.

I also learnt about stack which I already knew since I previewed this material during the winter break. Not only that, CSC 108 also briefly went over the topic on stack. So I had no problem understanding the stack.

I also finished my first CSC 148 assignment with my partner. The assignment was basically focused on how to implement subclass and how we can make a game without any start-up code provided. For CSC 108 assignments, we used to get some start-up codes provided and we just had to put additional code. However, it was different for CSC 148. The only thing we got was an instruction paper and we had to think of writing codes from the very beginning. Although it was a bit of challenge, I really liked the idea that we code the entire thing for Subtract Square game. I also had fun writing up the codes.

The last thing I learnt was recursion and tracing. Although I had trouble with recursion, my TA really helped me understand the recursion. I am confident that I did well on my Tutorial Quiz #3. I really enjoyed learning recursion and hope to achieve 2/2 on the quiz

Finally, I have my first CSC 148 exam next week. So I will study hard during the weekend. I also think that writing this SLOG post also helped me review the materials for the exam.  Let's do this, Julian! You can do it!

1 comment:

  1. Very precise and interesting slog Entry. It is evident to see there is lot of effort by the writer.

    ReplyDelete