需要求3个长方柱的体积,请编写一个基于对象的程序.数据成员包括length长、width宽、height高.
要求用成员函数实现以下功能:
(1)由键盘分别输入3个长方柱的长、宽、高;
(2)计算长方柱的体积;
(3)输出3个长方柱的体积.
请编程序,上机调试并运行.
人气:359 ℃ 时间:2020-04-13 13:31:00
解答
#include
using namespace std;
class A
{
double lengh,width,height;
public:
A(){lengh=width=height=0;}
void input();
void output();
}
A::void input()
{
cout
推荐
猜你喜欢
- 北宋时期有个著名的画家叫文与可,他特别喜欢画竹子.“胸有成竹”就是由此而来的,它的意思是?
- 1.Peter has just arrived,but he talks as if he __a___ everything here.
- 68.某商店销售一批服装,每件售价150元,打8折出售后,仍可获利20元,设这种服装的成本价为每件x元,
- 用“续”组成不同的词语,填入下面的句子中.
- 怎么把一个三角形变成一个正方形(剪两刀后)
- many a customer complains about the poor quality of the washing machine.其中many a costomer怎么翻译
- 一滑动变阻器'要求连入电路后滑片P向左移动;电阻减;那么连入电路两接线柱是
- 一氧气瓶的体积是32升,其中氧气的压力为13.2x1000Kpa.规定氧气压力降至1.01x1000