This is my 4.6, not much different than yours. Before I start these, I'm lost as can be, but after I get it typed, it all makes sense!

@interface Complex: NSObject
-(void) setReal: (double) a;
-(void) setImaginary: (double) b;
-(double) real;
-(double) imaginary;
-(void) print; // display as 'a + bi
@end
@implementation Complex
{
double real;
double imaginary;
}
-(void) setReal: (double) a
{
real = a;
}
-(void) setImaginary:(double)b
{
imaginary = b;
}
-(double) real;
{
return real;
}
-(double) imaginary
{
return imaginary;
}
-(void) print
{
NSLog(@"%.2f + %gi", real, imaginary);
}
@end
int main(int argc, const char * argv[])
{
@autoreleasepool {
Complex *myNumber = [[Complex alloc] init];
[myNumber setReal: 2];
[myNumber setImaginary:5];
[myNumber print];
}
return 0;
}