-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject5.cc
51 lines (43 loc) · 1.1 KB
/
project5.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* @file: project5.cc
*
*@brief:
* Main program for CPS222 project 5 - test driver to read in a graph
* from standard input and test the read graph
*
* @Authors: Elijah Opoku-Nyarko & Jake Colbert
*/
#include <iostream>
#include <string>
#include "./province.h"
using namespace std;
/*
* check if we are at the end of the file
*/
bool eof() {
char c;
cin >> c;
// if the fie is ended, return true
if (cin.eof()) {
return true;
} else {
// if the file contains more data, return the previously gotten
// data to cin
cin.unget();
return false;
}
}
int main(int argc, char *argv[]) {
// Repeatedly read input from standard input
while (!eof()) {
// create a new graph for each loop, which will read all of the
// corresponding data per graph
Province theProvince(cin);
cout << endl;
cout << "------------------------------------------------" << endl;
cout << "---------------- New DataSet: ------------------" << endl;
cout << "------------------------------------------------" << endl;
cout << endl;
theProvince.printAll(0, cout);
}
}