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 VisualBasic console project;
call it Algebra.vb.
You can rename the module name -- just right-click on the name from the
Solution Explorer panel -- to MixedToImproperModule if you want.
Create a new Class;
call it MixedToImproper.vb.
Type out the adjoining Visual Basic (VB.Net) code for converting mixed to improper fractions.
Feel free to try out your own whole number, numerator and denominator.