We've already briefly gone over recursion a couple of weeks ago, but it was nice to review it again. I still don't know if I have the hang of it because we've practiced tracing multiple examples, but I don't know if I'm proficient at writing recursive functions myself. So far, we've done the tree_burst example and the sum_list example. What other functions could I write myself? I think looking for some examples online might help.
I've looked over the assignment 1 handout a few times already, and I know I understand the Cheese class. The hardest part is writing all of the headers and function calls for the TOAHModel class. I don't quite understand how to model the stools. Is it a list? How do I add "n" cheese to each stool? Why do I need a function that asks how many moves I've made so far? There's already one in the MoveSequence class. I'm definitely going to ask for help on that. Once I understand what to do, I think I'll be able to get a good head start on the assignment. There's no way I'm leaving it to the last minute. Sometimes when I'm walking to class I'll suddenly come up with a way to solve the problem. It's the best feeling ever.
Thursday, 30 January 2014
Wednesday, 22 January 2014
Week 3: Object Oriented Programming
This week, the lecutres and labs were focused on object oriented programming. We worked on a Stack class mostly, and at this point I think I have a solid understanding of it. I know what a stack does, I know how to push and pop objects, and I know how to write simple method calls. The most difficult part was inheritance because I didn't quite understand how Stack and IntStack interacted. I was able to follow most of what was said in lecture, but I definitely need to review the examples on my own time.
Another thing I need to review is exceptions. I felt like we skimmed over the topic too quickly in lecture, and although we went through a couple of examples, there wasn't a lot of structure in terms of teaching us how to write an exception. With that said, my plan is to look over the class examples and make my own notes on how to write exceptions.
I really enjoyed the lab this week. My partners and I actually got through the entire thing within the allotted time (thank goodness), and the difficulty of the lab was just right. We struggled with finding a way to make the Queue class faster, though. We discussed it for a bit, but we weren't able to come up with anything. How can we preserve the indices' order so that it doesn't have to reset every time we add or remove something from the queue? I guess that's something I will have to think about for a while and possibly ask about later on.
Another thing I need to review is exceptions. I felt like we skimmed over the topic too quickly in lecture, and although we went through a couple of examples, there wasn't a lot of structure in terms of teaching us how to write an exception. With that said, my plan is to look over the class examples and make my own notes on how to write exceptions.
I really enjoyed the lab this week. My partners and I actually got through the entire thing within the allotted time (thank goodness), and the difficulty of the lab was just right. We struggled with finding a way to make the Queue class faster, though. We discussed it for a bit, but we weren't able to come up with anything. How can we preserve the indices' order so that it doesn't have to reset every time we add or remove something from the queue? I guess that's something I will have to think about for a while and possibly ask about later on.
Subscribe to:
Posts (Atom)