assignment 2
$10-30 CAD
着払い
Q1. Create a class called Rational for performing arithmetic with fractions. Write a program to test your class.
Use integer variables to represent the private data of the class – the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it is declared. The constructor should contain default values in case no initialisers are provided and should store the fraction in reduced form. For example, the fraction 2/4, should be stored in the object as 1 in the numerator and 2 in the denominator. Provide public member functions that perform each of the following tasks:
• Adding two Rational numbers. The result should be stored in reduced form.
• Subtracting two Rational numbers. The result should be stored in reduced form.
• Multiplying two Rational numbers. The result should be stored in reduced form.
• Dividing two Rational numbers. The result should be stored in reduced form.
• Printing Rational numbers in the form a/b, where a is the nominator and b is the denominator.
• Printing Rational numbers in floating point format.
プロジェクトID: #7089064
プロジェクトについて
アワード:
HI Contact me for an efficient, perfect, well documented development of your project according to 100% accuracy and requirements, with dedicated support. Thanks Farah Saif
5人のフリーランサーが、平均$26 で、この仕事に入札しています。
Hi, its me again. I would like to work with you again if given the opportunity. I have read the requirements and I would like to do this project. Let me know if you are interested. Thanks.
Hi there, I'm used to do similar projects like this one, so really hope to have chance to work with you, thanks for your consideration! Regards.
Hello I can deliver the assignment in 24 hours time. Let's discuss . Thanks..........................