Fractional Numbers
Like we all know, fractional numbers can either be Proper (e.g. 2/5), Improper (e.g. 5/2), or Mixed (e.g. 21/2),
Like we all know, fractional numbers can either be Proper (e.g. 2/5), Improper (e.g. 5/2), or Mixed (e.g. 21/2),
Say we have the fraction 32/5 - which is a mixed fraction; we can convert this fraction to an improper fraction by following a number of steps:
Multiply the whole number (3), by the denominator (5)
⇒ 3 X 5 = 15
Add the result from Step 1 to the numerator (2)
⇒ 15 + 2 = 17
Our obtained improper fraction is our new numerator (17) divided by our denominator (5).
Create a new java project;
call it Algebra.
Create a new java class file;
call it MixedToImproper.
Type out the adjoining Java code for converting mixed to improper fractions.
Feel free to try out your own whole number, numerator and denominator.