Class Array Objects using .h and .cpp files

My problem is listed below. The header file is already provided below but it doesn't seem to be complete? It doesn't have any constructors or a destructor. I've built a choice menu for the user to pick from and need to program the following:

a) Read from a text file and store the information into a student records class array. Delete the information and start over if this option is chosen again.
-Question: The header file has a static variable for filePath_ but I'm not sure how to incorporate it in my code here.
b) Allow manual entry from standard input and store the information in the same student records array. First it needs to check if the record already exists by comparing the first and last name. This option uses the AddEntryFromConsole() function and I'm not sure how to incorporate the operator == function with this.
c) print records to standard output - I don't think this should be an issue once I have the rest figured out.

Finally, my main.cpp file is to have very little code and functions should be defined in my StudentRecords.cpp file; however, that means they would need to be declared in my StudentRecords.h file, correct? That is why I think this provided header file is not complete. Also, we are not using pointers or vectors in this assignment.

Thank you,
Casandra


Create a simple student database application. It must use the following StudentRecord class. This comprises the contents of the header file StudentRecord.h. For full credit on this assignment you must use this header file (it is OK to use the string type instead of character arrays).

const int ENTRY_SZ = 256;

struct DateType
{
unsigned int year_;
unsigned int month_;
unsigned int day_;
};

class StudentRecord
{
private:
char firstName_[ENTRY_SZ];
char lastName_[ENTRY_SZ];
int idNum_;
char major_[ENTRY_SZ];
char minor_[ENTRY_SZ];
DateType dob_;

public:

static int entryCnt_;
static char filePath_[ENTRY_SZ];

void SetFirstName(const char fName[]);
void SetLastName(const char lName[]);
void SetIdNum(int id);
void SetIdNum(const char id[]);
void SetMajor(const char major[]);
void SetMinor(const char minor[]);
void SetDOB(const char dob[]);

// Copies some properties into out arguments
void GetFirstName(char name[], int sz) const;
void GetLastName(char name [], int sz) const;

void AddEntryFromConsole();
void PrintToConsole();
void AppendToFile();

StudentRecord& operator=(const StudentRecord& obj);
};

bool operator== (const StudentRecord& obj1, const StudentRecord& obj2);
Well, we won't do your homework. Do you have any specific problems?

-Question: The header file has a static variable for filePath_ but I'm not sure how to incorporate it in my code here.
How could we answer that? There is no code?
Topic archived. No new replies allowed.