Читал, но только по английски - может чего и не понял
Задача звучит так:
Please do Chapter 11 Programming Project 5. This single project will exercise all the items we covered in the lesson. The project is to create and test a class named Rational that can be used to store rational numbers.
A rational number is nothing more than a number than can be represented by a fraction, i.e., the ratio of two whole numbers. A whole number like 100 is represented as: 100/1
A fractional number like 0.5 is represented by: 1/2
Your class will need to store two internal, integer values for each Rational number, the numerator (top) and denominator (bottom) of the fraction. It will have three constructor functions, with zero, one and two arguments, used as follows:
Rational test1, test2(10), test3(1, 2);
The declaration for test1 calls the default (no argument) constructor, which should set the value to 0. (Like any other whole number, zero will have a 1 in the denominator: we cannot divide by zero.) The declaration for test2 calls a constructor with one argument. The value for test2 will be 10, stored as 10 on the top and 1 on the bottom. The declaration for test3 calls the constructor with two arguments. test3 is equal to 0.5, with 1 on the top and 2 on the bottom.