Fractions class

I have the following assignment:

Design the class Fraction that can be used to manipulate fractions in a program. Among others, the class Fraction must include methods to add, subtract, multiply, and divide fractions. When you add, subtract, multiply, or divide fractions, your answer need not be in the lowest terms.

Write a Java console program using the class Fraction that performs operations on fractions. Override the method toString so that the fraction can be output using the output statement.

This is what I have so far:

import java.util.*;

publicclass Fraction

{

privatefinalint numerator;

privatefinalint denominator;

public Fraction(int num,int denom)

{

this.numerator = num;

this.denominator = denom;

}

publicint getNumerator()

{

return numerator;

}

publicint getDenominator()

{

return denominator;

}

public Fraction reciprocal()

{

int n;

int d;

n = getDenominator();

d = getNumerator();

returnnew Fraction(n, d);

}

public Fraction add(Fraction other)

{

//...

}

public Fraction subtract(Fraction other)

{

//...

}

public Fraction multiply( Fraction x )

{

returnnew Fraction ( numerator * x.numerator,

denominator * x.denominator);

}

public Fraction divide( Fraction x)

{

returnnew Fraction ( numerator * x.denominator,

denominator * x.numerator);

}

public String toString()

{

return numerator +"/" + denominator;

}

}

Can you guys see how I am screwing this up?

Thanks

[3428 byte] By [superfoolioa] at [2007-11-27 9:11:47]
# 1
What problems are you having?
CaptainMorgan08a at 2007-7-12 21:57:39 > top of Java-index,Java Essentials,New To Java...
# 2
> What problems are you having?Adequately describing the problem.
floundera at 2007-7-12 21:57:39 > top of Java-index,Java Essentials,New To Java...
# 3

I am taking an online class. I have been reading the assignments and doing the work but I think that I am obviously missing something. I am hoping that you experts will look at the codes I have written and say " Oh this dullard forgot to "

Please let me know if I am oversimplifying, but I am not looking for someone to do my work, I just want to understand what it is that I am missing.

Thanks for your help.

superfoolioa at 2007-7-12 21:57:39 > top of Java-index,Java Essentials,New To Java...
# 4

That's not how it works. We are providing our help for free. We don't pour over every bit of code posted here and fix it for people. If you want that level of sevice go to rentacoder.com.

What service is provided here is that you describe what your problem is. Give us as much info as possible. That is, compiler errors. Indicate on which lines they occur. If no errors but wrong output then provide examples of your output and what is the expected output. etc etc

floundera at 2007-7-12 21:57:39 > top of Java-index,Java Essentials,New To Java...
# 5
It would help also if they knew what the code was supposed to do and what it is doing
pberardi1a at 2007-7-12 21:57:39 > top of Java-index,Java Essentials,New To Java...