Question: implement in c++ -----------------Date Class example ----------------- --------------------------- C++ ----------------------- class Date { private : int day; int month; int year; public : Date ()

 implement in c++ -----------------Date Class example ----------------- --------------------------- C++ ----------------------- class

implement in c++

-----------------Date Class example -----------------

--------------------------- C++ -----------------------

class Date {

private :

int day;

int month;

int year;

public :

Date () {

this->day = 1;

this->month = 1;

this->year = 1970;

}

Date(int day, int month, int year){

this->day = day;

this->month = month;

this->year = year;

}

Date(const Date& date){

this->day = date.day;

this->month = date.month;

this->year = date.year;

}

void setDay(int day) {

this->day = day;

}

int getDay() const {

return day;

}

void setMonth(int month) {

this->month = month;

}

int getMonth() const {

return month;

}

void setYear(int year) {

this->year = year;

}

int getYear() const {

return year;

}

void show() const {

cout

}

};

Student -id : int -firstName : string -lastName : string -enrolDate : Date getid(): int +setld(id:int) : void +getFirstName(): string *setFirstName(firstName : string): void +getLastName(): string *setLastName(lastName : string): void getEnrolDate(): Date *setEnrolDate(enrolDate : Date): void Student(id:int , firstName : string, lastName : string, en rolDate : Date) display(): void Date -day: int -month : int |-year: int +getDay(): int *setDay(day:int) : void +getMonth(): int *setMonth(month : int): void getYear(): int *sete arye ar: int) : void +Date(day: int, month : int, year : int) +display:void Given the composition relationship described in the UML diagram above has been implemented; complete the following: Implement a method named 'saveRecord' that accepts as argument a Student object and stores the details of the object to a file named 'students.dat'. Tabs should be used as the delimiter for the fields in the record written to the file. For example: Test Result Student student(1, "Roger", "Hall", Date(28, 8, 2019)); ID Number: 1 if(saveRecord(student)) { First Name: Roge student.display(); Last Name: Hall } Enrolled: 28/8/2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!