I downloaded the source of the Fraction Calculator and compiled it on the iPhone Simulator and came across a problem. Whenever you type in 3/2 ÷ 3/2 and then click plus, it says the answer is 3 when the answer is 1. I searched back through it and found out what the problem is. The processOp method looks like this:

-(void) processOp: (char) theOp {

NSString *opStr;

op = theOp;

switch (theOp) {

case '+': opStr = @" + "; break;

case '-': opStr = @" − "; break;

case '*': opStr = @" × "; break;

case '/': opStr = @" ÷ "; break;

}

[self storeFracPart];

// If it's a chain operation, e.g., 1/2 + 3/5 + 2/3

// do the first operation and store that as the first operand

if (firstOperand == NO) {

[myCalculator performOperation: op];

[displayString setString:

[myCalculator.accumulator convertToString]];

myCalculator.operand1.numerator = myCalculator.accumulator.numerator;

myCalculator.operand1.denominator = myCalculator.accumulator.denominator;

} // 1/2 + 3/4 = + 5/6 = ...

else if ([displayString isEqualToString: @""] == YES) {

[displayString setString:

[myCalculator.accumulator convertToString]];

myCalculator.operand1.numerator = myCalculator.accumulator.numerator;

myCalculator.operand1.denominator = myCalculator.accumulator.denominator;

}

firstOperand = NO;

isNumerator = YES;

[displayString appendString: opStr];

[display setText: displayString];

}

Where it should look like this:

-(void) processOp: (char) theOp {

NSString *opStr;

char oldOp = op;

[self storeFracPart];

op = theOp;

switch (theOp) {

case '+': opStr = @" + "; break;

case '-': opStr = @" − "; break;

case '*': opStr = @" × "; break;

case '/': opStr = @" ÷ "; break;

}

// If it's a chain operation, e.g., 1/2 + 3/5 + 2/3

// do the first operation and store that as the first operand

if (firstOperand == NO) {

[myCalculator performOperation: oldOp];

[displayString setString:

[myCalculator.accumulator convertToString]];

myCalculator.operand1.numerator = myCalculator.accumulator.numerator;

myCalculator.operand1.denominator = myCalculator.accumulator.denominator;

} // 1/2 + 3/4 = + 5/6 = ...

else if ([displayString isEqualToString: @""] == YES) {

[displayString setString:

[myCalculator.accumulator convertToString]];

myCalculator.operand1.numerator = myCalculator.accumulator.numerator;

myCalculator.operand1.denominator = myCalculator.accumulator.denominator;

}

firstOperand = NO;

isNumerator = YES;

[displayString appendString: opStr];

[display setText: displayString];

}

If you can't see what I changed, I rearranged the top part of the method to include a "char oldOp" and set that to "op" before where you set "op to equal theOp", and the down below where the "if (firstOperand == NO)" statement, I changed the op to perform "oldOp" instead of "op" because the problem was that it was adding instead of dividing. You need to change that and then resubmit it to the app store.