//Student.cpp #include "Student.h" #include using namespace std; Student::Student(){ Name = "blank"; EMail = "blank"; Phone = "blank"; StreetName = "blank"; AptLetter = "blank"; City = "blank"; State = "blank"; Zip = "blank"; Other = "blank"; deleted = false; } /*void Student::AddStudent(ifstream& inFile){ string ReadMe; getline(inFile, ReadMe, '\n'); //while ReadMe is not equal to "@@" while(ReadMe != "@@"){ if(ReadMe == "@E-mail:" ){ inFile >> Email; } else if(ReadMe == "@Address Line 2:"){ getline(inFile, AptLetter, '\n'); } else if(ReadMe == "@City:"){ getline(inFile, City, '\n'); } else if(ReadMe == "@Other:"){ getline(inFile, Other, '\n'); } else if(ReadMe == "@Phone Number:)"{ getline(inFile, Phone, '\n'); } else if(ReadMe == "@Address Line 1:"){ getline(inFile, StreetName, '\n'); } else if(ReadMe == "@Zipcode:"){ inFile >> Zip; } else if(ReadMe == "@Name:"){ getline(inFile, Name, '\n'); } else if(ReadMe == "@State:"){ inFile >> State; } else{ ReadMe == "blank"; } getline(inFile, ReadMe, '\n'); } }*/ //////////////////////////////////////////////////////////////// // // // Parameters: // // // Pre: // // Post: // // Returns: Describe what value the function returns, if any. // // Called by: // Calls: // bool Student::AddStudent(ifstream& inFile, string ReadMe){ //cout << " adding students \n"; bool Owned = false; //getline(inFile, ReadMe, '\n'); //while ReadMe is not equal to "@@" while(ReadMe != "@@"){ //cout << endl << ReadMe; if(ReadMe == "@E-mail:" ){ Owned = true; getline(inFile, EMail, '\n'); //cout << endl << EMail << endl; } else if(ReadMe == "@Address Line 2:"){ getline(inFile, AptLetter, '\n'); //cout << endl << AptLetter << endl; } else if(ReadMe == "@City:"){ getline(inFile, City, '\n'); //cout << City << endl; } else if(ReadMe == "@Other:"){ getline(inFile, Other, '\n'); //cout << endl << Other < // // // Parameters: // // // Pre: // // Post: // // Returns: Describe what value the function returns, if any. // // Called by: // Calls: // void Student::PrintInfo(ofstream& outFile){ //cout << "PRINTING INFORMATION\n"; //cout << Name; if(Name != "blank"){ outFile << "\nName:"; outFile << endl << " " << Name; } if(Phone != "blank"){ outFile << "\nPhone Number:"; outFile << endl << " " << Phone; } if(EMail != "blank"){ outFile << "\nEmail:"; outFile << endl << " " << EMail; } if(City != "blank" || State != "blank" || Zip != "blank" || StreetName != "blank" || AptLetter != "blank"){ outFile << "\nAddress:"; if(StreetName != "blank"){ //cout << StreetName; outFile << endl << " " << StreetName; } if(AptLetter != "blank"){ outFile << endl << " " << AptLetter; } if(City != "blank"){ outFile << endl << " " << City; if(State!= "blank" || Zip!= "blank"){ outFile << ","; } } if(State != "blank"){ if(City == "blank"){ outFile << endl; } outFile << " " << State; } if(Zip != "blank"){ if(City == "blank" && State == "blank"){ outFile << endl; } outFile << " " << Zip; } //outFile << endl; } if(Other!= "blank"){ outFile << "\nOther:"; outFile << endl << " " << Other; } outFile << endl; } void Student::DeleteStudent(){ deleted = true; Name = "blank"; EMail = "blank"; Phone = "blank"; StreetName = "blank"; AptLetter = "blank"; City = "blank"; State = "blank"; Zip = "blank"; Other = "blank"; } bool Student::ReturnDeleted(){ return deleted; } void Student::UnDelete(){ deleted = false; }