全文预览

java语言程序设计作业答案

上传者:相惜 |  格式:doc  |  页数:158 |  大小:1581KB

文档介绍
s Student{РString id;РString name;Рfloat scoreOfenglish;Рfloat scoreOfmath;Рfloat puter;Рfloat scoreOfsum;Р Р//构造方法Рpublic Student(){Р}Рpublic Student(String aid,String aname,float ascoreOfenglish,float ascoreOfmath,float puter){Рthis.id=aid;Рthis.name=aname;Рthis.scoreOfenglish=ascoreOfenglish;Рthis.scoreOfmath=ascoreOfmath;Рthis.puter=puter;Р//this.scoreOfsum=ascoreOfenglish+ascoreOfmath+puter;Рthis.scoreOfsum=sum();Р}Р Р Р//sum方法Рpublic float sum(){Рreturn(this.scoreOfenglish+this.scoreOfmath+this.puter);Р}Р Р Р//testScore测评成绩/平均分Рpublic float testScore(){Рreturn(this.scoreOfsum/3);Р}Р Р Р//6个get方法Рpublic String getid(){Рreturn(id);Р}Рpublic String getname(){Рreturn(name);Р}Рpublic float getscoreOfenglish(){Рreturn(scoreOfenglish);Р}Рpublic float getscoreOfmath(){Рreturn(scoreOfmath);Р}

收藏

分享

举报
下载此文档