subject

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: 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. simplify the fraction. for instance, for 0.75: multiply by ten repeatedly: 0.75×10×10=75 thus the numerator is 75 and the denominator is 10×10=100. simplify the fraction: find the factors of the numerator and the denominator. 75→{1,3,5,15,25,75}100→{1,2,4,5,10, 20,25,50,100} find the greatest common factor of each and divide both by it. 75÷25=3100÷25=4 0.75→34 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 it! ) write a function fraction( n ) which accepts a decimal number n and returns a tuple ( numerator, denominator ) of the resulting fraction representation.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
Consider the following statements: #include #include class temporary { private: string description; double first; double second; public: temporary(string = "", double = 0.0, double = 0.0); void set(string, double, double); double manipulate(); void get(string& , double& , double& ); void setdescription(string); void setfirst(double); void setsecond(double); }; write the definition of the member function set() so that the instance variables are set according to the parameters. write the definition of the constructor so that it initializes the instance variables using the function set() write the definition of the member function manipulate() that returns a decimal number (double) as follows: if the value of description is "rectangle", it returns first * second if the value of description is "circle" it returns the area of a circle with radius first if the value of description is "cylinder" it returns the volume of a cylinder with radius first and height second. hint: the volume of a cylinder is simply the area of the circle at the base times the height. if the value of description is "sphere" it returns the volume of the sphere with radius first. otherwise it returns -1.0;
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Match the following. 1. show grouping of word processing tasks that can be performed quick access toolbar 2. shortcut location for commonly used elements scroll bars 3. organized commands used to modify documents ribbon 4. used to align and measure content in a word screen zoom bar 5. vertical and horizontal bars that are used to navigate through a document contextual tabs 6. displays the name of the document in use ruler 7. allows users to enlarge or shrink a visual of a word document title bar
Answers: 2
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most? a)give the file a unique name b)name the file in yymmdd format c)use descriptive name while naming the files d)use capital letters while naming the file
Answers: 3
You know the right answer?
Although computers generally represent numbers as decimals, it is often convenient to express values...
Questions
question
English, 25.09.2020 22:01
question
Biology, 25.09.2020 22:01
question
Mathematics, 25.09.2020 22:01
question
Mathematics, 25.09.2020 22:01
Questions on the website: 13722362