Question: Using C sharp windows form Create a struct called Rational for performing arithmetic with fractions. Write an app to test your class. Use integer variables

 Using C sharp windows form Create a struct called Rational for

Using C sharp windows form Create a struct called Rational for performing arithmetic with fractions. Write an app to test your class. Use integer variables to represent the private variables of the struct-the numerator and the denominator. Provide a constructor that enables an object of this struct to be initialized when it's declared. The constructor should store the fraction in reduced form. The fraction 2/4 is equivalent to 1/2 and would be stored in the object as 1 in the numerator and 2 in the denominator. Provide public methods that perform each of the following operations (all calculation results should be stored in a reduced form): Add two Rational numbers. Subtract two Rational numbers. Multiply two Rational numbers. and Divide two Rational numbers

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!