student.h

来自「一次作业练习」· C头文件 代码 · 共 36 行

H
36
字号
#ifndef STUDENT_H
#define STUDENT_H

#include <fstream>
#include <string>
#include <iomanip>

class Student{
      public:
             Student();//post: has constructed an empty Student-object
             Student(string n, int id);//post: has constructed an student-object with name = n, student_id = id
             string get_name(); //get the student's name
             int get_id(); //get the student's id
             void set_name(string n); //set n as the student's name
             void set_id(int id); //set id as the student's id
             virtual void read(istream& fin);//pre: fin contains at least one line with a name and a student-id
                                    //post: has read and stored the name and student-id
             virtual void write(ostream& fout);//post: has written a line containing the name and the student_id


      private:
              string name;
              int student_id;






};



#endif

⌨️ 快捷键说明

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