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

📄 student.h

📁 压缩包里有教材<<C++模式设计-基于QT4开源跨平台开发框架>>所有源码
💻 H
字号:
#ifndef STUDENT_H#define STUDENT_H#include <QString>class Student  { public:    Student(QString nm, long id, QString m_Major, int year = 1);    ~Student() {}    QString getClassName() const; /* There are other ways             of identifying the classname that are better              than defining a getClassName() for each class.             getClassName() is used here only to demonstrate             how inheritance and polymorphism work. */    QString toString() const;    QString yearStr() const; private:    QString m_Name;    QString m_Major;    long m_StudentId; protected:    int m_Year;};class Undergrad: public Student { public:    Undergrad(QString name, long id, QString major, int year);    QString getClassName() const;};class GradStudent : public Student { public:    enum Support { ta, ra, fellowship, other };    GradStudent(QString nm, long id, QString major,                 int yr, Support support);    QString getClassName() const ;    QString toString() const; protected:    static QString supportStr(Support sup) ; private:    Support  m_Support;};#endif        //  #ifndef STUDENT_H

⌨️ 快捷键说明

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