⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 studentrecord.cc

📁 C++ class and storage
💻 CC
字号:
//studentRecord.cc#include <iostream>#include <string>#include "studentRec.h"using namespace std;studentRecord::studentRecord(){studentNumber=0; *_firstName="FNU"; *_lastName="LNU"; for(int i=0;i<NUM_OF_MARKS;i++)  {marks[i]=0;}}	studentRecord::~studentRecord()	{}	void studentRecord::setStudentNumber(unsigned int studentNum){studentNumber=studentNum;}	void studentRecord::setFirstName(char* firstName){_firstName=firstName;}	void studentRecord::setLastName(char* lastName){_lastName=lastName;}	void studentRecord::setMark(int index, unsigned int mark){marks[index]=mark;}	unsigned int studentRecord::*getStudentNumber() const{return(studentNumber);}	string studentRecord::*getFirstName() const{return(_firstName);}	string studentRecord::*getLastName() const{return(_lastName);}	unsigned int studentRecord::getMark(int index) const{return(marks[index]);}void studentRecord::print() const{cout<<"Student number: "<<studentNumber<<endl; cout<<"Student name: "<<*_lastName<<", "<<*_firstName<<endl; cout<<"Student marks: "<<marks[0]<<", "<<marks[1]<<", "<<marks[2]<<", "<<marks[3]<<", "<<marks[4]<<endl;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -