文件名称:5-VC
介绍说明--下载内容来自于网络,使用问题请自行百度
设计名为Circle的类,表示圆。这个类包含:
一个名为radius的double型数据成员,表示圆的半径.
数据成员的设置器setr和获取器getr函数。
一个名为area()的函数,返回圆的面积。
一个名为perimeter()的函数,返回圆的周长
编写测试主函数:创建2个Circle类对象,将第1个圆的半径设置为2.5,第2个圆的半径设置为3.5,并输出两个圆对象的半径、面积和周长。-Design class named Circle, expressed circle. This class includes: a double-type data member named radius, the radius of the circle indicates setr data setter and getter getr member function. A function named area () returns the area of a circle. A function called perimeter () returns circumference of a circle to write test main function: to create two Circle class object, the first one radius of the circle is set to 2.5, the first two radius of the circle is set to 3.5, and the output of two radius of the circle object, area and perimeter.
一个名为radius的double型数据成员,表示圆的半径.
数据成员的设置器setr和获取器getr函数。
一个名为area()的函数,返回圆的面积。
一个名为perimeter()的函数,返回圆的周长
编写测试主函数:创建2个Circle类对象,将第1个圆的半径设置为2.5,第2个圆的半径设置为3.5,并输出两个圆对象的半径、面积和周长。-Design class named Circle, expressed circle. This class includes: a double-type data member named radius, the radius of the circle indicates setr data setter and getter getr member function. A function named area () returns the area of a circle. A function called perimeter () returns circumference of a circle to write test main function: to create two Circle class object, the first one radius of the circle is set to 2.5, the first two radius of the circle is set to 3.5, and the output of two radius of the circle object, area and perimeter.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
作业5 VC.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.