Class Description

In this lab you will get a chance to work with classes and passing arguments from the command line. You will be creating a class for fractions. The fraction class will have data members to hold the numerator and denominator, both of which will be whole numbers.

Your class will need to have the following member functions:

  1. Output a fraction in a function called "Output".
  2. A reciprocal function called "Reciprocal".

You will be inputing your data for this lab using command line arguments.

Additionally your class should have constructors that:
  1. Initialize the fraction to 1/1.
  2. Allows fractions to be declared and intialized in the following format:
      Fraction frac(int numerator, int denominator)
    This constructor will also check to make sure the denominator is not zero.

You will be putting your main() funtion into a file called "Lab6.cpp", but you will be putting your class declaration and definitions into the files "Fraction.h" and "Fraction.cpp", respectively.

Here is a skeleton for Lab6.cpp:

#include <iostream >
#include "Fraction.h"

using namespace std;


int main()
{
    //Create 3 fractions:
    //  - Take in the first fraction from the command line. 
    //    Find the reciprocal of this fraction and print it to the screen.
    //  - The second fraction will be created with default values. You
    //    should also print this to the screen.
    //  - Then you will attempt to create a fraction with a denominator
    //    of zero, which should print an error

    return 0;
}