//========================================================================== // Bargraph of Exam Scores: An introduction to class interactions. // Read scores from a user-specified file; display them as a bar graph. // A. Fischer, September 30, 2000 file: graphM.cpp // Modified M. & A. Fischer, September 17, 2009 //========================================================================== #include "tools.hpp" #include "graph.hpp" int main ( void ) { banner(); Graph::instructions(); // Call of static class method char fname [80]; cout << "Name of data file: "; cin >> fname; // *** IRRESPONSIBLE CODE *** // cin.getline(fname, 80); // Prevents buffer overrun ifstream infile (fname); // Declare and open input stream if (!infile) fatal( "Cannot open %s for input - aborting!!\n", fname ); else say ( "File is open and ready to read.\n"); Graph curve( infile ); // Declare and construct a Graph object. // Realizes data structure from a file cout <