/////////////////////////////////////////////////////////////////// // Project 2 for CS 1704 Fall 2003 // // Programmer: Richard Moore // Last modified: February 23, 2004 // // Purpose //You will be implementing a console, command line based Multimedia Organizer. The basic idea is that your current Video, CD, DVD, cassette, etc collection should be able to be organized along with other students' collections so that we have a huge database of multimedia items that can be borrowed, traded, etc. //The first class you will create will hold student information. Each "student" should store that student's name, phone number, email address, street name with number, apartment letter and/or number, city, state, zip code, and other. (We will assume each student has standard U.S. addresses). Each student class should provide access functions to private data to update/view the information. //The second class will be a multimedia item. Each item will have a name, a type, an author, an owner (which will be a student email), a price, and a field indicating whether the item is one of the following: will sell, will rent, will trade, will lend, or none of the above. Each student class should provide access functions to private data to update/view the information //You will then create a third class that will manage the first two classes by storing an array of students and an array of multimedia items. This class will initially (constructor, we'll learn this in class) open two files. The first will be a list of students with accompanying information named "students.data". The second file will be a list of multimedia items named "items.data". /////////////////////////////////////////////////////////////////// // 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 text book 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. // // <038 52 2611> /////////////////////////////////////////////////////////////////// #include #include #include #define NDEBUG #include #include "controller.h" using namespace std; void organize(ifstream&, ofstream&, controller&); //Used to read in commands int main() { ifstream inFile; //Read in data ofstream outFile; //Output data unsigned int idNum =0; //Number associated with student controller organizer; //organizer outFile.open("output.data"); inFile.open("commands.data"); organize(inFile, outFile, organizer); //Call function to organize data inFile.close(); //Close input file outFile.close(); //Close output file return 0; } //////////////////////////////////////////////////////////////// // Reads in commands from the command.data input file and calls in functions accordingly. // // Parameters: // -ifstream& inFile --- read in information from commands.data // -ofstream& outFile --- allow writing to a common output file called output.data // -controller& organizer -- the object that contains the informatino to be manipulated // // Pre: -None // // Post: -None // // Returns: boolean value true/false // // Called by: Main(); // // Calls: -deleteEmail(); addStudent(); addItem(); printItems(); printEmail(); printStudents(); // ////////////////////////////////////////////////////////////////////////////////// void organize(ifstream& inFile, ofstream& outFile, controller& organizer) { string command; //String used to follow string command_2; //Second command inFile>>command; //Read in command while(inFile) { if(command == "delete") { inFile>>command_2; ////cout<<<<<>command; //Read in next command } else if(command == "quit") { ////cout<<<<<>command_2; ////cout<<<<<>command; //Read in next comand } else if(command == "print") { inFile>>command_2; ////cout<<<<<>command; //Read in next comand } } }