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

📄 student.h

📁 一次作业练习
💻 H
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -