Question: 3/3] Fraction CS101 . C- l https://relate.cs.llinois.edu/course/cs101-sp18/flow-session/404158/2/ Converting a decimal to a fraction 10 points Although computers generally represent numbers as decimals, it is often
![3/3] Fraction CS101 . C- l https://relate.cs.llinois.edu/course/cs101-sp18/flow-session/404158/2/ Converting a decimal to](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f0b09693448_87866f0b0961d273.jpg)

3/3] Fraction CS101 . C- l https://relate.cs.llinois.edu/course/cs101-sp18/flow-session/404158/2/ Converting a decimal to a fraction 10 points Although computers generally represent numbers as decimals, it is often convenient to express values as fractions. If we desire to convert a decimal to a fraction, we need to follow a two-step process: 1. Starting with the number itself, multiply by ten repeatedly until no values remain after the decimal point. This is the numerator. Keep the multiplier as the denominator. 2 Simplity the fraction 1. Multiply by ten repeatedly: For instance, for 0.785: 0.75x 10 x 10 75 Thus the numerator is 75 and the denominator is 10 x 10 2. Simplify the fraction: 100 1. Find the factors of the numerator and the denominator. 751,3,5,25,75 100,2,4, 5, 10, 20, 25, 50, 100 2. Find the greatest common factor of each and divide both by it 75 253 100 25-4 0.75 - Write a function factors( n) which accepts a number n and returns a list containing all of the factors of that number. (This is a common task. Write your own code-don't just google it!) Write a function fraction n) which accepts a decimal number n and retuns a tuple numerator,denominator) of the resulting fraction representation Your submission should include two functions factors( n) and fraction( n). Starter code (cick to view)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
