Challenge Solution / Tips


To override costInDollars and valueInDollars use super to basically modify the originals in the parent class:

[code]-(float) costInDollars {
float foreign = [super costInDollars];
return foreign * conversionRate;

-(float) valueInDollars {
float foreign2 = [super valueInDollars];
return foreign2 * conversionRate;

Then add a few instances of our new class to the array, and make sure you set the conversion rate for conversion:

[portfolio4 setPurchaseSharePrice:2.30]; [portfolio4 setCurrentSharePrice:4.50]; [portfolio4 setNumberOfShares:40]; [portfolio4 setConversionRate:0.94];

When you iterate through your array, make sure that the new class with the new methods are there:

That should do the trick :slight_smile: