問題詳情

49. 小文設計了一個計算矩形面積的類別 CalculateArea,其宣告如下,則下列哪一個成員函式(Member Function)定義正確?


(A) void CalculateArea:: SetPara(double L, double W){Length = L;Width = W;}
(B) double GetLength( ){return Length;}
(C) CalculateArea:: GetWidth( ){return Width;}
(D) double CalculateArea:: GetArea( ){ Area = Length * Width;}

參考答案

答案:A
難度:計算中-1
書單:沒有書單,新增