第十周實驗報告1

2021-06-06 00:33:56 字數 683 閱讀 5230

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

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

* 檔名稱:由座標點類派生出直線類。

* 完成日期: 2012 年 04 月23日

* 版 本 號: v1.0

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

* 輸入描述:

* 問題描述:

* 程式輸出:

* 程式頭部的注釋結束

*/

#include#includeusing namespace std;    

class point //定義座標點類

point(double x0,double y0)

void printp()

double line::length();//計算直線的長度

void line::printl()

int main()

1st  point:(-2,5)

2nd  point:(7,9)

the middle point of line:  point:(2.5,7)

the length of line: 9.84886

point:(2.5,7)

請按任意鍵繼續. . .

第十周實驗報告(1)

任務1 在下面一段類的定義中,需要填充的函式由注釋內容給出了功能 include includeusing namespace std class point 定義座標點類 point double x0,double y0 void printp class line public point 利...

第十周實驗報告1

實驗目的 填充 實現相應的功能 實驗 include include using namespace std class point 定義座標點類 point int x0,int y0 void printp class line public point 利用座標點類定義直線類,其基類的資料成員...

第十周實驗報告(任務1)

源程式 include includeusing namespace std class point 定義座標點類 point double x0,double y0 void printp cout point 運算結果 1st point 2,5 2nd point 7,9 the middle...