/********************************************************************************************
driver.cpp
Jim Millard
Practical 10
********************************************************************************************/
#include <iostream>
#include "compass.h"
using namespace std;
void paces(compass& c);
void main() {
//no arguments
compass cTest;
paces(cTest);
//create using arguments
compass cTest2(45,15); //45 degrees, 15 minutes
paces(cTest2);
cout << "Individual elements: " << endl
<< " Degrees: " << cTest2.getDegree() << endl
<< " Minutes: " << cTest2.getMinute() << endl
<< " Seconds: " << cTest2.getSecond() << endl;
cout << "Add the first to the second: " << cTest + cTest2 << endl;
cout << "Add the first to the second: ";
cTest2.addSame(cTest);
cTest2.print();
cout << endl;
}
void paces(compass& c) {
//putting the object through it's paces...
cout << "Start: " << c << endl;
compass::setDD(true);
cout << " " << c << endl;
compass::unsetDD();
int i;
for (i = 0; i < 4; i++) {
cout << "Add 35s: ";
c.addSecond(35);
c.print();
cout << endl;
}
for (i = 0; i < 4; i++) {
cout << "Add 35m: ";
c.addMinute(35);
c.print();
cout << endl;
}
c.setDD(true);
for (i = 0; i < 4; i++) {
cout << "Add 200d: ";
c.addDegree(200);
c.print();
cout << endl;
}
cout << endl;
c.setDD(false);
}