第五周任務1 4

2021-06-05 06:38:10 字數 635 閱讀 5393

/* (程式頭部注釋開始)

* 程式的版權和版本宣告部分

* 檔名稱:

* 作 者:劉楊

* 完成日期:2012 年 3 月 21 日

* 版 本 號:

* 對任務及求解方法的描述部分

* 輸入描述:

* 問題描述:

* 程式輸出:

* 程式頭部的注釋結束

*/#include#includeusing namespace std;

class ********

; ********::********(float x, float y, float z):a(x),b(y),c(z){} //(4)在建構函式中使用引數初始化表對資料成員初始化。

float ********::perimeter(void)

float ********::area(void)

void ********::showmessage()

{ cout<

執行結果:

第五周任務1 4

程式頭部注釋開始 include includeusing namespace std class float perimeter void 計算三角形的周長 float area void 計算並返回三角形的面積 void showmessage private float a,b,c 三邊為私有...

第五周 任務四

對任務及求解方法的描述部分 輸入描述 問題描述 程式輸出 程式頭部的注釋結束 include using namespace std class student void display int num float score int main student p stud cout void ma...

第五周 任務四

任務4 設計乙個學生類,包括學號 num 和成績 score 建立乙個物件陣列,內放5個學生的資料,要求 1 用指標指向陣列首元素,輸出第1 3 5個學生的資訊 2 設計乙個函式max,用指向物件的指標作函式引數,在max函式中找出5個學生中成績最高者,並輸出其學號。includeusing nam...