Implement a simple class in your favorite language.
- by Oscar Reyes
I'm doing this to learn syntax of different programming languages.
So, how would you defined the following class along with with it's operations in your favorite programming language?
Image generated by http://yuml.me/
And a main method or equivalent to invoke it:
For instance, for Java it would be:
...
public static void main( String [] args ) {
Fraction f = new Fraction();
f.numerator( 2 );
f.denominator( 5 );
f.print();
}
....