欢迎来到天天文库
浏览记录
ID:58867533
大小:78.00 KB
页数:6页
时间:2020-09-21
《实验七面向对象1.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、实验七面向对象1信科09-1班朱云超学号:08093526第一题#includeusingnamespacestd;classTime{public:voidset_time();voidshow_time();private:inthour;intminute;intsec;};voidTime::set_time(){cin>>hour;cin>>minute;cin>>sec;}voidTime::show_time(){cout<2、main(){Timet;t.set_time();t.show_time();return0;}输出结果:第二题#includeusingnamespacestd;classcircle{public:doublelength();doublesquare();voidset_value();private:doubleb;};doublecircle::length(){return(b*2*3.14);}doublecircle::square(){return(b*b*3.14);}voidcircle::3、set_value(){cin>>b;cout<4、money1<usingnamespacestd;classcomplex{public:complex(doublea1=0.0,doubleb1=0.0,doublea2=0.0,doubleb2=0.0);voiddisplay();voidadd();voidsubtruct();private:doublea1,a2;doubleb5、1,b2;};complex::complex(doublex1,doubley1,doublex2,doubley2){a1=x1;b1=y1;a2=x2;b2=y2;}voidcomplex::add(){cout<<"("<6、ut<<"("<usingnamespacestd;classsum{public:voidset_value(intn);voidclear_value(intn);voidsearch(intn);private:inta[1000];intb[1000];};void7、sum::set_value(intn){inti;cout<<"对a、b两个集合初始化"<>a[i];cout<<"集合b:";for(i=0;i>b[i];}voidsum::clear_value(intn){intm,i;cout<<"输入0对两个集合进行置空"<>m;for(i=0;i8、tn){inti,j;cout<<"求交集:";for(i=0;i
2、main(){Timet;t.set_time();t.show_time();return0;}输出结果:第二题#includeusingnamespacestd;classcircle{public:doublelength();doublesquare();voidset_value();private:doubleb;};doublecircle::length(){return(b*2*3.14);}doublecircle::square(){return(b*b*3.14);}voidcircle::
3、set_value(){cin>>b;cout<4、money1<usingnamespacestd;classcomplex{public:complex(doublea1=0.0,doubleb1=0.0,doublea2=0.0,doubleb2=0.0);voiddisplay();voidadd();voidsubtruct();private:doublea1,a2;doubleb5、1,b2;};complex::complex(doublex1,doubley1,doublex2,doubley2){a1=x1;b1=y1;a2=x2;b2=y2;}voidcomplex::add(){cout<<"("<6、ut<<"("<usingnamespacestd;classsum{public:voidset_value(intn);voidclear_value(intn);voidsearch(intn);private:inta[1000];intb[1000];};void7、sum::set_value(intn){inti;cout<<"对a、b两个集合初始化"<>a[i];cout<<"集合b:";for(i=0;i>b[i];}voidsum::clear_value(intn){intm,i;cout<<"输入0对两个集合进行置空"<>m;for(i=0;i8、tn){inti,j;cout<<"求交集:";for(i=0;i
4、money1<usingnamespacestd;classcomplex{public:complex(doublea1=0.0,doubleb1=0.0,doublea2=0.0,doubleb2=0.0);voiddisplay();voidadd();voidsubtruct();private:doublea1,a2;doubleb
5、1,b2;};complex::complex(doublex1,doubley1,doublex2,doubley2){a1=x1;b1=y1;a2=x2;b2=y2;}voidcomplex::add(){cout<<"("<6、ut<<"("<usingnamespacestd;classsum{public:voidset_value(intn);voidclear_value(intn);voidsearch(intn);private:inta[1000];intb[1000];};void7、sum::set_value(intn){inti;cout<<"对a、b两个集合初始化"<>a[i];cout<<"集合b:";for(i=0;i>b[i];}voidsum::clear_value(intn){intm,i;cout<<"输入0对两个集合进行置空"<>m;for(i=0;i8、tn){inti,j;cout<<"求交集:";for(i=0;i
6、ut<<"("<usingnamespacestd;classsum{public:voidset_value(intn);voidclear_value(intn);voidsearch(intn);private:inta[1000];intb[1000];};void
7、sum::set_value(intn){inti;cout<<"对a、b两个集合初始化"<>a[i];cout<<"集合b:";for(i=0;i>b[i];}voidsum::clear_value(intn){intm,i;cout<<"输入0对两个集合进行置空"<>m;for(i=0;i8、tn){inti,j;cout<<"求交集:";for(i=0;i
8、tn){inti,j;cout<<"求交集:";for(i=0;i
此文档下载收益归作者所有