欢迎来到天天文库
浏览记录
ID:37916650
大小:161.00 KB
页数:10页
时间:2019-06-02
《C#面向对象程序设计操作题》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、book类usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Windows.Forms;namespaceBookSales{abstractpublicclassbook:IPrintable{publicbook(){}publicbook(stringbookno,stringbookname,stringbublisher,stringpageCount){this.bookno=bookno;this.bookname=bookname;this.bublisher=bublisher;
2、this.pageCount=pageCount;}publicstringbookno;privatestringBookno{get{returnbookno;}set{bookno=value;}}publicstringbookname;privatestringBookname{get{returnbookname;}set{bookname=value;}}publicstringbublisher;privatestringBublisher{get{returnbublisher;}set{bublisher=value;}}publicstringpageCount;pri
3、vatestringPageCount{get{returnpageCount;}set{pageCount=value;}}publicvirtualvoidCalcPrice(stringa){floatprice;price=float.Parse(a)*20;MessageBox.Show(price.ToString());}publicvoidPrintReport(stringk){stringa="-----------------图书信息--------------"+"rr";stringb="图书编号:"+this.bookno+"rr";str
4、ingd="图书名称:"+this.bookname+"rr";stringe="出版社:"+this.bublisher+"rr";stringf="页数:"+this.pageCount+"rr";stringc="购买人:"+k+"rr";MessageBox.Show(a+b+c+d+e+f);}}}Soundbook类usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Windows.Forms;namespaceBookSales{clas
5、ssoundbook:book,IPrintable{publicsoundbook(){}publicsoundbook(stringbookno,stringbookname,stringbublisher,stringpageCount,stringsoundtype){this.bookno=bookno;this.bookname=bookname;this.bublisher=bublisher;this.pageCount=pageCount;this.soundtype=soundtype;}publicstringsoundtype;privatestringSoundty
6、pe{get{returnsoundtype;}set{soundtype=value;}}publicvoidPrintReport(stringk){stringa="-----------------图书信息--------------"+"rr";stringb="图书编号:"+this.bookno+"rr";stringd="图书名称:"+this.bookname+"rr";stringe="出版社:"+this.bublisher+"rr";stringf="页数:"+this.pageCount+"rr";stri
7、ngc="购买人:"+k+"rr";MessageBox.Show(a+b+c+d+e+f);}}}Picturebook类usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Windows.Forms;namespaceBookSales{classpicturebook:book,IPrintable
此文档下载收益归作者所有