Giúp tìm lỗi sai bài code class

#include <iostream>

class Birthday{
    int d;
    int m;
    int y;
    //Constructor
    public:
    Birthday(){d = 0; m = 0; y=0;};
    Birthday(const int &day, const int &month, const int &year){
        d = day; m = month; y = year;
    }

    //getter
    int getDay(){return d;}
    int getMonth(){return m;}
    int getYear(){return y;}

    //copy date
    void Copy(const Birthday &other){
         d = other.d;
         m = other.m;
         y = other.y;
    }
};

class student{
    std::string name;
    int age;
    Birthday date();
    std::string Hometown;
    std::string Class;
    std::string level_of_studying;

    //Construtor
    public:
    student(){name = "No Information"; age = 0; Hometown = "No Information"; Class = "No Information"; level_of_studying = "No Information";};
    student(const std::string &_name, const int &_age, const Birthday  &s_date,
            const std::string &_Hometown, const std::string &_Class, const std::string &_level_of_studying ){

        name = _name;
        age = _age;
        date.Copy(_date);
        Hometown = _Hometown;
        Class = _Class;
        level_of_studying = _level_of_studying;
    }

    //Print out screen student"s information
    Print(){
        std::cout<<"Student:" <<std::endl;
        std::cout<<"Name: " <<name <<std::endl;
        std::cout<<"Age: " <<age <<std::endl;
        std::cout<<"Birthday: " <<date.getDay() <<"/" <<date.getMonth() <<"/" <<date.getYear() <<std::endl;
        std::cout<<"Hometown: " <<Hometown <<std::endl;
        std::cout<<"Class: " <<Class <<std::endl;
        std::cout<<"Level_of_studying: " <<level_of_studying <<std::endl <<std::endl;
    }
};


int main()
{
    Birthday person_Birthday(17,7,2003);
    student person("Ha Son Tung", 18,person_Birthday,"Tuyen Quang","First year","Excellent");
    person.Print();
    return 0;
}

Termanal nó hiện lỗi như này nhưng em vẫn chưa biết sửa kiểu gì ạ.

class student{
...
    Birthday date(); // ?? declare một hàm `date()` và trả về kiểu `Birthday`
                     // mà không phải là declare một data member tên là `date`
                     // Trong trường hợp muốn gọi default initializer thì dùng dấu ngoặc nhọn nha: Birthday day{};
...


date.Copy(_date); // trong function signature, có paramater nào tên `_date` đâu?
                  // Thấy mỗi `s_date`


    Print(){ // quên specify return type à??
4 Likes

Dạ em hiểu rồi ạ em cảm ơn :heart_eyes: :heart_eyes: :heart_eyes:

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?