/******************************************************* PROGRAM NAME - rationaltester (problem 1) FILE NAME = rationaltester.cpp PROGRAMMER NAME - Justin C. Miller USAGE – type './rationalteser' to run me COMPILE – type 'make rationaltester' to use my makefile DATE - 09/17/2003 BUGS - I believe that everything works properly DESCRIPTION - This program test Problem 1 of the homework to see if the ceiling, floor, overloaded +,-,*,/ and << and >> work properly. *******************************************************/ #include #include #include "rational.h" using namespace std ; int main(int argc, char * argv[]){ // Problem 1: #3, overloaded >> and << rational a ; cout << "Please input a rational number: " ; cin >> a ; cout << "You entered: " << a << endl ; rational b(27,6) ; cout << "B was 27 / 6 but should now be normalized: " << b << endl ; // Problem 1: #2, overloaded +,-,*,/ cout << a << " + " << b << " = " << (a + b) << endl ; cout << a << " - " << b << " = " << (a - b) << endl ; cout << a << " * " << b << " = " << (a * b) << endl ; cout << a << " / " << b << " = " << (a / b) << endl ; // Problem 1: #1, ceiling and floor cout << "The ceiling of " << a << " is " << a.ceiling() << endl ; cout << "The ceiling of " << b << " is " << b.ceiling() << endl ; cout << "The floor of " << a << " is " << a.floor() << endl ; cout << "The floor of " << b << " is " << b.floor() << endl ; return EXIT_SUCCESS ; }//end of main