Question: FOR PYTHON 3.2. Design a class named Fraction that contains: - A private float data field named numerator - A private float data field named

FOR PYTHON 3.2. Design a class named Fraction that contains:

- A private float data field named numerator

- A private float data field named denominator

- A constructor that creates a fraction object

- Get and set methods for getting/setting each of the data fields

- Overload method for printing a Fraction object. If z is a fraction with a numerator of 2 and denominator of 5, then print(z) should display 2/5

-Overload method for the multiplication operator (*). This method should return an object of type Fraction. Do not need to simplify the fraction.

Write a test portion (main) that will:

-Create 2 Fraction object

- Print each of them to the shell

-Multiply them and print result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!