// Program: userational_test.cpp
// the operations for rational numbers
#include
#include "rational.cpp"
int main ()
{
// input
std::cout << "Rational number r:\n";
rational r;
std::cin >> r;
std::cout << "Rational number s:\n";
rational s;
std::cin >> s;
// test the operations
std::cout << "Sum is " << r + s << ".\n";
// Exercise 130: (see tutorial of Nov 19)
// std::cout << "Difference is " << r - s << ".\n";
// std::cout << "Product is " << r * s << ".\n";
// std::cout << "Quotient is " << r / s << ".\n";
std::cout << "r == s? " << (r == s) << ".\n";
// Exercise 131:
std::cout << "r != s? " << (r != s) << ".\n";
std::cout << "r < s? " << (r < s) << ".\n";
std::cout << "r <= s? " << (r <= s) << ".\n";
std::cout << "r > s? " << (r > s) << ".\n";
std::cout << "r >= s? " << (r >= s) << ".\n";
return 0;
}