It is required to do it in C++ visiual Studio
In a language that supports operator overloading, build support for rational numbers. Each number should be represented internally as a (numerator, denominator) pair in simplest form, with a positive denominator. Your code should support unary negation and the four standard arithmetic operators. Also, create a conversion routine that accepts two floating-point parameters – a value and an error bound – and returns the simplest (smallest denominator) rational number within the given error bound of the given value.
Expert Answer
refer the attached image
complete logic with comments.
please upvote if I helped you. 🙂