#include #include #include #include #include "ManageMultimedia.h" using namespace std; #define NDEBUG // :) //////////////////////////////////////////////////////////////// DEFAULT CONSTRUCTOR // Default ManageMultimedia Constructor. Loads all the information from the files // and puts it into the appropriate array // // Parameters: None // Pre: // Post: All variables are initalized // // Returns: None // // Called by: Anyone using the ManageMultimedia class may call this function // Calls: None ManageMultimedia::ManageMultimedia () { StudentFile.open ("students.data"); //opens the file OutputFile.open ("output.data"); //opens the file MultimediaFile.open ("items.data"); //opens the file string word; //temporary variable to hold a string int StudentBox(0); //holds the index in the student array while (StudentFile>>word) { if (word=="@E-mail:") { StudentFile>>word; myStuArray[StudentBox].ChangeEmail (word); //cout<>word; StudentFile>>word; if (word=="1:") { getline (StudentFile, word); getline (StudentFile, word); myStuArray[StudentBox].ChangeSAddress (word); //cout<>word; getline (StudentFile, word); getline (StudentFile, word); myStuArray[StudentBox].ChangePhone (word); //cout<>word) { if (word== "@Item:") { getline (MultimediaFile, word); getline (MultimediaFile, word); myMultiArray[MultiBox].ChangeItem (word); //cout<>word; getline (MultimediaFile, word); getline (MultimediaFile, word); myMultiArray[MultiBox].ChangeMediaType (word); //cout<=0) && (i<100) ); //provides bounds checking if ((myStuArray[i].Name()=="") && (myStuArray[i].Phone()=="") && (myStuArray[i].Email()== "") && (myStuArray[i].StreetAdd()=="") && (myStuArray[i].Appartment() =="") && (myStuArray[i].City() =="") && (myStuArray[i].State()=="") && (myStuArray[i].Zip() == "") && (myStuArray[i].OtherInfo() == "")) //blank entry { if (myStuArray[i]==newStu) { OutputFile<<"Failure"<=0) && (i<100) ); //provides bounds checking if ((myMultiArray[i].Item()=="") && (myMultiArray [i].MediaType ()=="") && (myMultiArray [i].Author ()=="") && (myMultiArray[i].Owner()== "") && (myMultiArray[i].Price()=="") && (myMultiArray[i].ItemLoc()=="")) { if (myMultiArray[i]==newItem) { OutputFile<<"Failure"<=0) && (s<100) ); //provides bounds checking if (myStuArray[s].Email()==email) { myStuArray[s].ChangeName (blankstring); myStuArray[s].ChangePhone (blankstring); myStuArray[s].ChangeEmail (blankstring); myStuArray[s].ChangeSAddress (blankstring); myStuArray[s].ChangeAppartment (blankstring); myStuArray[s].ChangeCity (blankstring); myStuArray[s].ChangeState (blankstring); myStuArray[s].ChangeZip (blankstring); myStuArray[s].ChangeInfo (blankstring); found=true; //found an instance of the email address } } for (int s (0); s<100; s++) { if (myMultiArray[s].Owner()==email) { //cout<<"Deleting "<=0) && (i<100) ); //provides bounds checking if (myStuArray[i].Email()!="") { if (myStuArray[i].Name()!="") OutputFile<<"Name:"<