You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
332 B
30 lines
332 B
4 years ago
|
#import "Fraction.h"
|
||
|
#import <stdio.h>
|
||
|
|
||
|
@implementation Fraction
|
||
|
-(void) print
|
||
|
{
|
||
|
printf("%i/%i", numerator, denominator);
|
||
|
}
|
||
|
|
||
|
-(void) setNumerator: (int) n
|
||
|
{
|
||
|
numerator = n;
|
||
|
}
|
||
|
|
||
|
-(void) setDenominator: (int) d
|
||
|
{
|
||
|
denominator = d;
|
||
|
}
|
||
|
|
||
|
-(int) denominator
|
||
|
{
|
||
|
return denominator;
|
||
|
}
|
||
|
|
||
|
-(int) numerator
|
||
|
{
|
||
|
return numerator;
|
||
|
}
|
||
|
@end
|