Purchase Solution

# Java program rational fractions

Not what you're looking for?

Rational fractions are of the form a / b, where a and b are integers and b != 0. In this exercise, by "fractions" we mean rational fractions. Suppose a / b and c / d are fractions. Arithmetic operations on fractions are defined by the following rules:

a/b + c/d = (ad + bc) / bd

a/b - c/d = (ad - bc) / bd

a/b * c/d = ac / bd

(a/b) / (c/d) = ad / bc Hint: Check carefully to avoid divide by zero!

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.

##### Solution Summary

The expert examines Java programs for rational fractions.

##### Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

##### Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

##### C# variables and classes

This quiz contains questions about C# classes and variables.