This is a tentative version. There may be some minor changes. Check this file again ina few days. Jan 13: Correction to rational.h There should be a const at the end of the prototype for get_double so it reads as follows double get_double() const; This has been corrected in the file rational.h. CSE 9B Winter 1997 Assignment 2: DUE DATE: DO NOT TURN IN THIS ASSIGNMENT BEFORE THURSDAY Jan 16. Due dates: turnin program Tuesday Jan 21 interview Monday Jan 27 (NOTE THAT IT IS MONDAY) REQUIRED READING: Savitch text Chapter 8. PROGRAMMING: Chapter 8, Programming Project 5 (page 491) of the Savitch text. This assignment asks you to define a class for Rational numbers. You are to define it in three files: a header file, implementation file, and an application file which is a test of your class definition. We have provided you with the header file and the application (test program) file; they are in rational.h and test_rational.cxx. All you have to do is give the implementation file, which you should call rational.cxx. You will ONLY TURN in the implementation file rational.cxx. However, you should check to see that your implementation works correctly with the other two files. Be sure that you store all rationals in reduced form. So, for example, 2/-4 is stored with a numerator of -1 and denominator of 2, not with a numerator of 2 and a denominator of -4. The private member function reduced can be used for this. NOTE: You are given the code for the member function reduced. It is in the file named Rational::reduced. Hint: Code and test your implementations for the member functions one at a time. Completely test one before coding the implementation of the next one. It may help to use the test program test_rational.cxx with blocks commented out with /* and */. As you add more implementation you can make the /* to */ section smaller and smaller until it is completely gone. We will discuss this technique of implementing and testing your definition in more detail in class. NOTE 1: You must use the header file, rational.h completely unchanged. NOTE 2: You should create a make directory and make file to test your implementation, but you only turn in the implementation file rational.cxx. There is a make file that you can use in the file named make. See the file makefiles.info in public for information on makefiles. They are not covered in the Savitch text, but will be covered in class. Compiled code: The file hw02.o contains the compiled code for a program that behaves just as your implementation should behave on the test program. hw02.o will run as it is. It is like the final object code from the make file that combines the header file, application file, and test program. Free Code! The file hw02.freecode has two of the function definition already done for you.