driver
Code:#include <string.h> #include <iostream.h> #include <fstream.h> #include <stdlib.h> #include "building.h" void main() { building b[12]; char userLocA[10]; char userLocB[10]; ifstream input_file; input_file.open("paths.txt"); if(input_file.fail()) { cout <<"Input file could not be opened.\n"; exit(1); } for(int index=0; index<12; index++) { b[index].intLocationOne(input_file.getline()); b[index].intLocationTwo(input_file.getline()); b[index].setPath(input_file.getline()); } cout <<"\nCAMPUS DIRECTIONS!\n"; cout <<"Here are your building choices:\n"; cout <<"Student Center, Weaver, CTLM, and Coolbaugh\n"; cout <<"Where are you now?"; cin >> userLocA; cout <<"Where do you want to go?"; cin >> userLocB; for (int 12) { if ((strcmp(userLocA, r[index].getLocation1()))&&(strcmp(userLocB, r[index.getLocation2())))) { cout << "Here are your directions:" << b[index].getPath(); break; } } }



LinkBack URL
About LinkBacks


