CSCI assignment

profileh2o
next_step.docx

The attached gzipped tarball contains all of the files needed. To extract it type:

tar zxvf a12.tar.gz

For this in-class assignment, assemble into groups of your choosing (the same groups used for the adventure assignment would be good) and implement the Webcounter class. The class declaration for Webcounter should be written in Webcounter.h. The getsetreset, and hit member functions should be written in Webcounter.cpp. The class should be tested using the included test program.

After implementing the four member functions and confirming the code works correctly, add two more member functions:

1. load This member function takes a string as an input parameter and return nothing (void). The function should open up a file whose name is provided as the input parameter. If the file doesn't exist, just assign 0 to the Webcounter's private data. If the file does exist, then read in a number from the file and assign it to Webcounter's private data.

2. save This member function takes the name of an output file as the function's parameter. This member function should open up the file, write the private member data to the file, and then close the file.

Although everyone is working in groups, each student is required to turn in the code individually. Before turning in your code be sure to "make clean". Then, move to the parent directory (the directory that contains a12) and type:

tar czv Webcounter.cpp Webcounter.h test_counter.cpp Makefile >solution_a12.tar.gz

Submit solution_a12.tar.gz below.