View this PageEdit this PageUploads to this PageVersions of this PageHomeRecent ChangesSearchHelp Guide

MP2 Discussion

Lorinc Hever 10:30:39 pm on 28 May 2007: I'm getting doesNotUnderstand: #amountPaid in Part1/Ex.1 from GraderHW2 after adding the necessary methods, does anybody else has similar problem?

Nicholas Chen May 29, 2007 - Can you debug through it? Try inspecting what the type of the object that is being returned. You need to return a Paycheck object since that is the object that has the amountPaid method on it.

Lorinc Hever 12:18:55 pm on 29 May 2007: Thanks, yes I didn't put the correct implementation in the method, and actually this implementation on the slides so I just need to copy carefully :)



Jeffrey Votteler 3:48:45 pm on 1 Jun 2007: Is anyone running Squeak on Linux? I have installed both 3.7-7 and 3.9-8 on my x86_64 system at work. I have been able to get Squeak to run and perform MP0 and MP1. However, when I try to do World Menu > Open > File List, Squeak simply hangs. If I try to open the .st file with just File (instead of File List) I get errors when trying to do the fileIn command

Jeffrey Votteler 4:24:56 pm on 1 Jun 2007: I figure it out. Instead of using the menus, I simply draged a FileList window from the Tools tab. This worked fine and I now see CS598rej-Payroll HW2 in the System Browser.



James Shepherd June 3, 2007 - Is there a standard notation for specifying a method inherited by the subclass that is calling a method in the inherited class's super class? This is in reference to part 2 of MP2. An easier question...Is there a notation just for describing an inherited method being executed?

Nicholas Chen June 3, 2007 - Not that I know of. You can just mention is as part of the comments.

However, for Part 2 of HW2, all you need to do is describe the results of each evaluation. Using normal sentences is fine.



An-Hoe Shih June 3, 2007 - I have implemented the classes in part 2 and for the last bullet of e), "ex4 result3", it seems invoking the test method of Two class. Does this mean that super is relative to the class the inherited method is defined (instead of the class of the receiver)?

Nicholas Chen June 3, 2007 - Yes that is correct. See more information about the super pseudo-variable here. You can think of it as being determined statically; i.e. relative to the class that actually defined the method which contains the "super" pseudo-variable. In this case since the result3 method is defined in Class Three it calls the superclass of Class Three.


Steve Rowe June 4, 2007 - After I create all of the creation/initialization methods, I get an error in the testPayrollSystemWithJohn case. I understand I'm supposed to, but the error has nothing to do with testTakeHomePay. It occurs during setUp. Specifically, transactions is nil and I don't see it being initialized anywhere. Is this something I need to do in the initializer? If so, what type of object should it be?

Nicholas Chen June 5, 2007 - I am not able to reproduce this problem. On my system, I removed the "testTakeHomePay" method from PayrollSystemTestCase. Then I ran "GraderHW2" testing suite. I got a "doesNotUnderstand: #testTakeHomePay" which is expected. I did not get the problem with the "setUp" method in "GraderHW2" since there is no "setUp" method there.

Where is the transactions variable that you are referring to? Also, which initializer are you referring to? The way I implemented my solution does not require the use of an initializer.

Steve Rowe Jun 5, 2007 - The setUp that I'm getting the error from is in PayrollSystemTestCase. Employee has a nil transactions object. I fixed the problem by putting initialization for this in the initializer for Employee. I also had to initialize several other Employee variables and some other items. I didn't get the impression from the description that I would need to do that much. Is that intentional or did I somehow get a corrupt image?

Steve Rowe June 5, 2007 - Never mind. I figured it out. Somehow I nuked the default Employee>>named: implementation. Recreating it helped me learn more at least.

Link to this Page