原创 十四周作業1

#include <iostream> using namespace std; class MyArray { private: int *arr; //用於存放動態分配的數組內存首地址 int size; //數組大小

原创 第十三週作業3

#include <iostream> using namespace std; class Shape { public: virtual float area() const = 0; }; class Circle:publ

原创 第十週作業2

//【任務2】定義一個名爲CPerson的類,有以下私有成員:姓名、身份證號、性別和年齡,成員函數:構造函數、析構函數、輸出信息的函數。並在此基礎上派生出CEmployee類,派生類CEmployee增加了兩個新的數據成員,分別用於表示部

原创 第十三週作業1

#include <iostream> using namespace std; class Vehicle { public: void run() const { cout << "run a vehicle. "<<end

原创 第十二週作業4

//自行定義類 //用下面的main()函數測試 #include <iostream> #include <cmath> using namespace std; class Point { public: Point(flo

原创 第十二週作業2

#include<iostream> #include<string> using namespace std; class Teacher { public: Teacher(stri