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

📄 coursetype.h

📁 C++编成数据结构与程序设计方法 D.S.Malk编著
💻 H
字号:
//Header file courseType.h

#ifndef H_courseType
#define H_courseType

#include <fstream>
#include <string>

using namespace std;

class courseType
{
public:
    void setCourseInfo(string cName, string cNo, int credits);
      //Function to set the course information.
      //The course information is set according to the 
      //parameters.
      //Postcondition: courseName = cName; courseNo = cNo; 
      //               courseCredits = credits; 

    void print(ostream& outF);
      //Function to print the course information.
      //This function sends the course information to the
      //output device specified by the parameter outF. If the 
      //actual parameter to this function is the object cout, 
      //then the output is shown on the standard output device. 
      //If the actual parameter is an ofstream variable, say 
      //outFile, then the output goes to the file specified by 
      //outFile.

    int getCredits();
      //Function to return the credit hours.
      //Postcondition: The value of courseCredits is returned.

    string getCourseNumber();
      //Function to return the course number.
      //Postcondition: The value of courseNo is returned.

    string getCourseName();
      //Function to return the course name.
      //Postcondition: The value of courseName is returned.

   courseType(string cName = "", string cNo = "",
              int credits = 0);
      //Constructor 
      //The object is initialized according to the parameters.
      //Postcondition: courseName = cName; courseNo = cNo; 
      //               courseCredits = credits;

private:
    string courseName;  //variable to store the course name
    string courseNo;    //variable to store the course number
    int courseCredits;  //variable to store the credit hours
};

#endif

⌨️ 快捷键说明

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