2013年10月9日星期三
Upcoming challenge
It's been quite a while since school started and I am starting to feel a bit more confident on what I am doing now. The exercise 3 allows me to have a more detail idea of how inheritance works, however, somethings I still have trouble defending which class inherit from which, like which is the parent class. I think the opposite way at the beginning, I thought the class with more attributes should inherit from the class with less attributes which is incorrect. I am stuck for quite a while on the Rectangle class that should be inherited from the Parallelogram class in exercise 3. The reason for that is that I don't know how can i modify the the attributes of Rectangle with the class being inherited from Parallelogram, because Rectangle has one less attribute than Parallelogram, that is the theta of the Rectangle is not given to us. However, as I clearly think it all over again, I remember the characteristics of Rectangle that is it is necessary for a Rectangle to have a 90 degree angle thus I set the Rectangle's attribute in its initializer method with a default mode of (self, base, side, 90) which actually give me the correct output of what I want. Being able to identify the key here in the Rectangle class allows me to solve the mystery of the Square class inheritance problem as well. A1 is an even more challenging task for us, but thanks to our professor that he allows us to work with partners. This is surely something that can benefit us, not by lessening our workload, but allow peers to help each other and solve problem together. However, to me, A1 seems a little bit too hard for students because the logic thinking involved is completed and the tkinter documentation is somewhat confusing. The test upcoming next week will be a real challenge to me and really hope I can manage to do okay on this test and goes on with this course.
订阅:
博文评论 (Atom)
没有评论:
发表评论