CS11 Intro C++ Lab 5: Operator Overloading

This assignment will give you an opportunity to practice C++ operator overloading best-practices (and other C++ best practices) in a reasonably simple context. You will need to implement a simple Rational class that represents rational numbers as numerator / denominator. The goal will be to implement most of the basic arithmetic operators, as well as the stream-output operator.

Your Rational class should be implemented in the files rational.h and rational.cpp. The class should also satisfy the following requirements:

Testing

A test suite for your class is provided here; make sure to fix any test failures you encounter.

Build Automation

Now that you know how to use make to automate your build process, create a Makefile for your project that builds and tests your Rational code.

Submitting Your Work

Once you have completed the above tasks, submit your work through csman. Make sure to submit these files:

You do not need to submit the test code; we will test your program with a fresh copy of these files.

Assignment Feedback Survey

Please also complete and submit a feedback survey with your submission, telling us about your experience with this assignment. Doing so will help us to improve CS11 Intro C++ in the future.


Copyright © 2018 by California Institute of Technology. All rights reserved. Generated from cpp-lab5.md.