No unassigned laptops in allAssets


#1

At the end of this chapter, when I run the program, I don’t get any unassigned objects (laptops) in the allAssets array, even though some of the laptops have $0 value and employees in the Employees array show up as having $0 in assets.

I have been trying to find out why it is working that way in the code, but so far have not been able to find it. Here is the output file:2012-04-07 14:50:52.563 BMITime[24057:403] Employees: ( "<Employee 0: $0 in assets>", "<Employee 1: $153 in assets>", "<Employee 2: $119 in assets>", "<Employee 3: $68 in assets>", "<Employee 4: $0 in assets>", "<Employee 5: $136 in assets>", "<Employee 6: $119 in assets>", "<Employee 7: $34 in assets>", "<Employee 8: $0 in assets>", "<Employee 9: $136 in assets>" ) 2012-04-07 14:50:52.637 BMITime[24057:403] Giving up ownership of one employee 2012-04-07 14:50:52.640 BMITime[24057:403] allAssets: ( "<Laptop 0: $0, assigned to <Employee 3: $68 in assets>>", "<Laptop 1: $17, assigned to <Employee 6: $119 in assets>>", "<Laptop 2: $34, assigned to <Employee 7: $34 in assets>>", "<Laptop 3: $51, assigned to <Employee 5: $136 in assets>>", "<Laptop 4: $68, assigned to <Employee 3: $68 in assets>>", "<Laptop 5: $85, assigned to <Employee 5: $136 in assets>>", "<Laptop 6: $102, assigned to <Employee 6: $119 in assets>>", "<Laptop 7: $119, assigned to <Employee 2: $119 in assets>>", "<Laptop 8: $136, assigned to <Employee 9: $136 in assets>>", "<Laptop 9: $153, assigned to <Employee 1: $153 in assets>>" ) 2012-04-07 14:50:52.641 BMITime[24057:403] Giving up ownership of an array

Any idea what the problem might be? Thanks in advance.


#2

Hi - just noticed the same in my version. You should just need to add the (missing) line

after the line

and should then see exactly the same output as in the book.