Grading criteria for CS494, HW1


Item

Points

Description

1

10

Does the code follow the Sun style guidelines?

2

10

Defining array in Version 1. Is there a constant for the capacity? Is there a field in the class to tell how many items are in the array? Did they construct this properly?

3

10

Updating array in Version 1. Do they check for full array before adding? When deleting from the middle of the array, do the move an item to the "hole" or shuffle items down?

4

5

Use of ArrayList in Version 2. Make sure they do not use a separate field to store the size or the capacity, but instead use the size() method on the container. There is no maximum capacity here.

5

5

Use of HashMap in Version 3. Check same thing as previous item. Also, make sure their use of Iterators looks OK. (NOTE: They can use either the Holding's ticker symbol as the key to add a Holding, or some may use the Holding itself as both arguments to add which works if they write a hashmap() method for Holding. Either way is OK.)

6

5

Class contents. Make sure there are no extra unneeded fields in the classes. They should calculate not store a Holding's value and gain/loss, and the Portfolio's total value.

9

5

Immutability of Holding. Do the methods that need to "change" a holding really create a new instance of the Holding? These are: Holding.updateNumShares(), Holding.updateCurrPrice().

10

5

Correctness of inspectors: Do all the getXXX() functions do what they're supposed to?

11

5

Portfolio.updatePrice() and sellShares() and addHolding(). Do these check for a negative arguments? See comments.

12

5

Portfolio.sellShares(). If we sell all shares, does this remove the Holding from the Portfolio?

13

5

Portfolo.addHolding(). Do we check if a Holding with that ticker is already stored?
     

14

15

General correctness. If you see other bugs, deduct points for each. Typically a bug might be worth a 3 or 5 point deduction.