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

📄 studentee.~cp

📁 一次作业练习
💻 ~CP
字号:
#include "StudentEE.h"

/*StudentEE();
             StudentEE(string n, int id);
             void read(istream& fin);
             void write(ostream& fout);*/


StudentEE::StudentEE()
{
 Student();
 course3=0;
 course4=0;
}


StudentEE::StudentEE(string n, int id)
{
 Student(n,id);
 course3=0;
 course4=0;
}


void StudentEE::read(istream& fin)
{
  string n;
  int id, c1,c2;
  fin>>n>>id>>c1>>c2;
  Student::set_name(n);
  Student::set_id(id);
  set_course1(c1);
  set_course2(c2);
}

//post: has written a line containing the name, student_id and 
//      course1 and course 2
void StudentCS::write(ostream& fout)
{
 fout<<Student::get_name()<<" "<<Student::get_id()<<" "<<get_course1()<<" "<<get_course2()<<endl;
}

void StudentCS::set_course1(int i)
{
 course1=i;
}

void StudentCS::set_course2(int i)
{
 course2=i;
}

int StudentCS::get_course1()
{
 return course1;
}

int StudentCS::get_course2()
{
 return course2;
}

⌨️ 快捷键说明

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