110k views
4 votes
Which option is correct about Fraction object? Select one: A. a = Fraction(1.1) generates the object Fraction (11,10). B. The sum of a Fraction object and an integer is a Fraction object. C. The sum of a Fraction object and a float number is a Fraction object. D. a= Fraction (1/5) generates the object Fraction (1,5). Which option is correct about Fraction object?

User K L
by
8.8k points

1 Answer

1 vote

Final answer:

Option B is correct. The sum of a Fraction object and an integer is a Fraction object.

Step-by-step explanation:

In computer programming, a "Fraction Object" would typically refer to an object-oriented representation or class for handling fractions. Fraction objects are used to store, manipulate, and perform operations on fractional numbers (ratios of two integers). The structure of a Fraction object might include attributes such as numerator and denominator, as well as methods for performing arithmetic operations.

Option B is correct. The sum of a Fraction object and an integer is a Fraction object.

For example, let's say we have the Fraction object a = Fraction(3/4) and an integer b = 2. When we add them, a + b, we get the Fraction object (11/4).

User Gigadot
by
9.3k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories