c++编写一个火车类Train

编写一个火车类Train
一、属性
车次 number,人数 count. 票价 price
二、函数
构造函数:Train(string m.int c.double p):设置任意车次
成员函数:getNum():返回车次;display():显示信息
4
三、并编写主函数测试(以你回家的乘坐的火车为例,建立对象进行测试)

你有啥困难?

#include <iostream>
#include <string>
using namesapce std;
class Train()
{
    private:
        string number;
        int count;
        double price;
    public:
        Train() {}
        Train(string m.int c.double p) {number = m;count=c;price=p;}
        string getNum() {return number;}
        void display() {cout<<"车次:"<<number<<endl; cout<<"人数:"<<count<<endl;cout<<"票价:"<<price<<endl;}
};
int main()
{
    Train t("G101",1250,485.0);
    t.display();
    return 1;
}