// Project 2 for CS 1704 Spring 2004 // // Programmer: Nikia R. Johnson // OS: Windows 2000 Professional // System: Pentium III 500, 256 MB Memory // Compiler: Visual C++ 6.0, Service Pack 4 // Last modified: October 12, 2003 // // //****************************************************************************************************** //On my honor: // // //-I have not discussed the C++ language code in my program with anyone //other than my instructor or the teaching assistants assigned to this course. // //-I have not used C++ language code obtained from another student, or any //other unauthorized source, either modified or unmodified. // //-If any C++ language code or documentation used in my program was //obtained from another source, such as a textbook or course notes, that //has been clearly noted with a proper citation in the comments of my //program. // //-I have not designed this program in such a way as to defeat or //interfere with the normal operation of the Curator System. // //Nikia Johnson //************************************************************************************************* #include #include #include #include #include #include "MediaItem.h" using namespace std; ifstream iFile; //********************************************************************************************************* //IMPLEMENTATION FILE (MediaItems) //This file implements the MediaItems member functions //********************************************************************************************************* void MediaItem::SetMediaItem(char itname[100], char itauthor[100], char itavail[100], char itprice[100], char itowner[100], char type[100]) { //Pre condition: no information has been read in from data file "items.data" // //Post condition: information has been read from first set of data in file "items.data" char symbol;//reads in first symbol of imput file char label;//reads in next char of input file iFile.get(symbol); if(symbol == '@') { iFile.get(label); switch (label) { case 'I': iFile.ignore(100, '\n'); iFile.get(itname,101); strcpy(itemname,itname); break; case 'M': iFile.ignore(100,'\n'); iFile.get( type, 101); strcpy(mediatype,type); break; case 'b': iFile.ignore(100,'\n'); iFile.get( itauthor, 101); strcpy(itemauthor,itauthor); break; case 'O': iFile.ignore(100, '\n'); iFile.get(itowner, 101); strcpy(itemowner,itowner); break; case 'P': iFile.ignore(100,'\n'); iFile.get(itprice, 101); strcpy(itemprice,itprice); break; case 'A': iFile.ignore(100, '\n'); iFile.get(itavail, 101); strcpy(itemavail,itavail); break; default:; } } }