OK. But someday I'll be able to get these decimals in the calculator so that 5 divided 4 doesn't say 1, but says 1.1 (1.3 in the Calculator app in OS X.) Here's the code once again:
- (IBAction) getSum:(id)sender;
{
int addend1, addend2, sum;
addend1 = [mathField1 doubleValue];
addend2 = [mathField2 doubleValue];
sum = addend1 + addend2;
[mathAnssetDoubleValue:sum];
}
- (IBAction) getDiff:(id)sender;
{
int minu, subtrah, diff;
minu = [mathField1 doubleValue];
subtrah = [mathField2 doubleValue];
diff = minu - subtrah;
[mathAnssetDoubleValue:diff];
}
- (IBAction) getPro:(id)sender;
{
int mulcand, mulpiler, pro;
mulcand = [mathField1 doubleValue];
mulpiler = [mathField2 doubleValue];
pro = mulcand * mulpiler;
[mathAnssetDoubleValue:pro];
}
- (IBAction) getQuote:(id)sender;
{
int numer, denom, quote;
numer = [mathField1 doubleValue];
denom = [mathField2 doubleValue];
quote = numer / denom;
[mathAns setDoubleValue:quote];
}
If this question has been answered, then I'll continue my Xcode development. If not, i'll have to throw my project in the trash. Leave me a suggestion.