上一页 1 ··· 4 5 6 7 8
  2017年3月13日
摘要: Description 定义一个类Data,只有一个double类型的属性和如下3个方法: 1. 带1个参数的构造函数——初始化属性值为参数值。 2. double getValue()——获得属性值。 3. void showValue()——显示属性值。 定义一个类Data,只有一个double 阅读全文
posted @ 2017-03-13 19:20 TogetherLaugh 阅读(309) 评论(0) 推荐(0) 编辑
摘要: Description 定义一个类Data,只有一个double类型的属性和如下3个方法: 1. void init(double d);——初始化属性值。 2. double getValue()——获得属性值。 3. void showValue()——显示属性值。 定义一个类Data,只有一个 阅读全文
posted @ 2017-03-13 19:18 TogetherLaugh 阅读(625) 评论(0) 推荐(0) 编辑
摘要: Description 编写一个带默认值的函数,用于求圆面积。其原型为: double area(double r=1.0); 当调用函数时指定参数r,则求半径为r的圆的面积;否则求半径为1的圆面积。 其中,PI取值3.14。 编写一个带默认值的函数,用于求圆面积。其原型为: double area 阅读全文
posted @ 2017-03-13 19:16 TogetherLaugh 阅读(396) 评论(0) 推荐(0) 编辑
摘要: Description 编写两个名为max的函数,它们是重载函数 ,用于求两个整数或实数的最大值。它们的原型分别是: int max(int a,int b); double max(double a,double b); 返回值是a和b的最大值。 编写两个名为max的函数,它们是重载函数 ,用于求 阅读全文
posted @ 2017-03-13 19:13 TogetherLaugh 阅读(307) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8