// This program demonstrates the Length class's overloaded 
// +, -, ==, and < operators.
// Adapted from pr11-10 in textbook
#include <iostream>
#include "Length.h"
using namespace std;

int main()
{
  Length first {0}, second {0}, third {0};
  int feet, inches;
  cout << "Enter a distance in feet and inches.\n";
  cout << "Feet: ";
  cin  >> feet;
  cout << "Inches: ";
  cin  >> inches;
  first.setLength(feet, inches);
  
  cout << "Enter another distance in feet and inches.\n";
  cout << "Feet: ";
  cin  >> feet;
  cout << "Inches: ";
  cin  >> inches;
  second.setLength(feet, inches);

  cout << "----- RESULTS -----" << endl;
  
   // Test the + and - operators
  third = first + second;
  cout << "first + second = ";
  cout << third.getFeet() << " feet, ";
  cout << third.getInches() << " inches\n";

  third = first - second;
  cout << "first - second = ";
  cout << third.getFeet() << " feet, ";
  cout << third.getInches() << " inches\n";
  
  // Test the relational operators
  cout << "first == second: ";
  if (first == second)
    { cout << "True\n"; }
  else
    { cout << "False\n";}

  cout << "first < second: ";
  if (first < second)
    { cout << "True\n"; }
  else
    {cout << "False\n"; }
  
  return 0;
}
