C语言基础课件-第十章 面向对象程序设计.pptVIP

  • 1
  • 0
  • 约9.33千字
  • 约 45页
  • 2019-07-18 发布于山东
  • 举报

C语言基础课件-第十章 面向对象程序设计.ppt

/*类成员函数实现*/ StudentReward_Punishment::StudentReward_Punishment(const char* rp_record,const char*num,const char*name,char s_sex,int s_age,float s1,float s2,float s3):Student(num,name,s_sex,s_age,s1,s2,s3) { strcpy(record,rp_record); } void StudentReward_Punishment::showRecord() { cout该学生受过的奖惩是:recordendl; } Void StudentReward_Punishment::writeRecord(const char* new_record) { strcpy(record,new_record); } * /*主函数测试程序*/ int main() { StudentReward_Punishment sp(全国大学生英语竞赛2等奖,2010160223,李娇,F,20,89,93,85); sp.show(); sp.showRecord(); sp.writeRecord(数学竞赛1等奖); sp.showRecord(); return 0; } * 程序运

文档评论(0)

1亿VIP精品文档

相关文档