The instructions for Exercise 10 in chapter 4 are not completely clear to me:
They state "The last two methods set the accumulator as well as perform the indicated operation on memory. Have all the methods return the value of the accumulator".
Based on that, I coded my implementations as:
// implemented right?
- (double) memoryAdd: (double) value
{
memory = memory + value;
return accumulator;
}
// implemented right?
- (double) memorySubtract: (double) value
{
memory = memory - value;
return accumulator;
}
... Should the accumulator, in addition to the memory, be included in the addition or subtraction of the passed-in value? The confusing part says that the methods set the accumulator... to what? the value passed in, or the value already in memory? Help. Thanks : )