名称 编程题3_4: 产品类Product 的设计 备注 描述 设计一个产品类 Product ,允许通过如下方式来创建产品对象: 通过指定产品名创建; 通过指定产品名和产品价格创建; 通过指定产品名、产品价格、出厂日期(对象成员)创建; Product 还应该包含如下属性:生产厂家、易碎标记、有效日期(使用对象成员)。设计该类时请至少增加 3 个其他属性。成员函数包括访问和修改这些属性的操作。 在 main( ) 中定义对象,并输出相关信息。 相关类的定义提示: class Product { char *name; double price; Date deptime; char *factory; bool easy_break; Date valtime; ........ public: ........ void output ( ); }; 输出函数提示 : void Product::output ( ) { cout< using namespace std; class Date { int year,month,day; public: Date(int y=2000,int m=1,int d=1) { year=y; month=m; day=d; } int Getyear() {return year; } int Getmonth() { return month; } int Getday() 参考源代码仅供老师参考,不要添加到系统中 { return day; } void settime(int y,int m,int d) { year=y;month=m;day=d; } }; class Product { char *name; double price; Date deptime; char *factory; bool easy_break; Date valtime; char *color; double high; public: Product(char *na); Product(char *na,double pr); Product(char *na,double pr,int x,int y,int z); void SetProduct(char *na,double pr,int x,int y,int z,char *fa,bool ea,int a,int b,int c, char *co,double h); void output(); }; Product::Product(char *na) { name=new...