NAME Circle your lab section Section 8, Thurs 6:30PM.
  Section 3, Thurs 8:30AM. Section 9, Fri 2:00PM.
EMAIL ID Section 4, Thurs10:30AM Section 10, Thurs 8:30PM.
  Section 5, Thurs 12:30PM. Section 11, Fri at Noon.
STUDENT ID Section 6, Thurs 2:30PM. Section 12, Fri 4:00PM.
  Section 7, Thurs 4:30PM. Section 13, Fri 10:AM

GRADING CRITERIA

POINTS

SCORE

Initial program comments identify, student ID, email, lab section number

10

 
All four files for the program submitted electronically under these names: holding.h   holding.cpp   portfolio.h   portfolio.cpp

20

 
Program compiles without serious warning messages, e.g., ones that indicate program incorrectness. (No partial credit for this item.)

20

 
The following functions have appropriate and meaningful comments describing their major sub-tasks that they carry out: Portfolio::AddHolding() and Portfolio::DisplayProportions()

20

 
All data members are declared private. All member functions only use member inspectors to access data members (except the array or vector elements).

10

 
No global variables are used.

10

 
Holding::GetValue() returns correct value.

5

 
Holding::GetGainLoss() returns correct value.

5

 
All constructors for Portfolio properly initialize data members.

10

 
Portfolio::AddHolding() correctly adds new Holding in a Portfolio.

10

 
If needed, Portfolio::AddHolding() checks if there is room in the collection for another Holding to be added.

5

 
Portfolio::AddHolding() prints error message(s) according to program specifications.

15

 
Portfolio::DeleteHolding() correctly updates the Portfolio if the Holding is stored there and returns true.

10

 
Portfolio::DeleteHolding() just returns false if a Holding is not stored in the Portfolio.

5

 
Portfolio::FindHolding() returns correct position for a holding if it is found.

10

 
Portfolio::FindHolding() returns correct position for a holding if it is not found.

10

 
Portfolio::GetTotalValue() returns correct value.

5

 
Portfolio::UpdatePrice() correctly updates a Holding stored in a Portfolio and returns true.

10

 
Portfolio::UpdatePrice() just returns false if a Holding is not stored in a Portfolio.

5

 
Portfolio::UpdatePrice() prints error message(s) according to program specifications.

5

 
Portfolio::SellShares() correctly updates a Holding stored in a Portfolio and returns true.

10

 
Portfolio::SellShares() just returns false if a Holding is not stored in a Portfolio.

5

 
Portfolio::SellShares() prints error message(s) according to program specifications.

10

 
Portfolio::SellShares() deletes the Holding if the sale reduces number of shares to zero.

5

 
Portfolio::Insert() uses the operator or member function defined in Holding when printing each Holding.

5

 
Portfolio::Insert() displays Portfolio name, correct total value, and correct total gain/loss.

15

 
Portfolio::DisplayProportions() correctly calculates and prints each Holding's percentage value.

5

 
Portfolio::DisplayProportions() correctly calculates and prints each Holding's percentage gain for the total gain, and percentage loss compared to the total loss.

5

 
Portfolio::DisplayProportions() correctly recognizes when to print "N/A" instead of a percentage.

10

 
TOTAL WITHOUT EXTRA CREDIT

270

 
Extra Credit: A sorting member function is correctly implemented for Portfolio and is called inside DisplayProportions() to display Holdings by total value.

20

 
OVERALL TOTAL

290