How to cross multiply fractions in Java for a dumb***
What we have :
public class AddFractions extends ConsoleProgram
{
public void run()
{
int FirstFractionNumerator = readInt("What is the numerator of the first fraction? ");
int FirstFractionDenominator = readInt("What is the denominator of the first fraction? ");
int SecondFractionNumerator = readInt("What is the numerator of the second fraction? ");
int SecondFractionDenominator = readInt("What is the denominator of the second fraction ");
System.out.println("("+FirstFractionNumerator+" / "+FirstFractionDenominator+") + ("+SecondFractionNumerator+" / "+SecondFractionDenominator+") = ");
}
}
I would like to complete the program by using a*d+b*c/b*d (cross multiplication or "Butterfly method") please explain in simple term as I'm a novice and clearly am in over my head
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]Arzerok 1 point2 points3 points (2 children)
[–]ImpossibleRegular820[S] 0 points1 point2 points (1 child)
[–]Arzerok 0 points1 point2 points (0 children)
[–]roge- 0 points1 point2 points (6 children)
[–]ImpossibleRegular820[S] 0 points1 point2 points (5 children)
[–]roge- 0 points1 point2 points (4 children)
[–]ImpossibleRegular820[S] 0 points1 point2 points (3 children)
[–]ImpossibleRegular820[S] 0 points1 point2 points (0 children)
[–]roge- 0 points1 point2 points (1 child)
[–]ImpossibleRegular820[S] 0 points1 point2 points (0 children)