zoukankan      html  css  js  c++  java
  • 自考新教材-p90_5(1)

    源程序:

    #include <iostream>
    #include <string>
    using namespace std;

    class Course
    {
    private:
    string coursename;
    int credit;
    int xueshi;
    string type;
    string profession;
    public:
    Course(string coursename1, int credit1, int xueshi1, string type1, string profession1)
    {
    coursename = coursename1;
    credit = credit1;
    xueshi = xueshi1;
    type = type1;
    profession = profession1;
    }
    string get_coursename()
    {
    return coursename;
    }
    int get_credit()
    {
    return credit;
    }
    int get_xueshi()
    {
    return xueshi;
    }
    string get_type()
    {
    return type;
    }
    string get_profession()
    {
    return profession;
    }
    };

    int main()
    {
    Course course("网络实训",4,4,"专业课","计算机网络");
    cout << "我叫李明"<<endl<<"本学期计算机网络只学一门专业课" << endl;
    cout << "课程名称是:";
    cout <<"《"<< course.get_coursename()<<"》"<<endl;
    cout<<"学分为:"<<course.get_credit()<<endl;
    system("pause");
    return 1;
    }

    运行结果:

  • 相关阅读:
    软件对标分析
    alpha内测版发布
    第一阶段项目评审
    第一阶段意见汇总
    冲刺(二十)
    冲刺(十九)
    冲刺(十八)
    冲刺(十七)
    冲刺(十六)
    冲刺(十五)
  • 原文地址:https://www.cnblogs.com/duanqibo/p/12268946.html
Copyright © 2011-2022 走看看