/*
* Copyright (c) 2015, 烟台大学计算机学院
* All rights reserved.
* 文件名称:test.cpp
* 作 者:姜甜甜
* 完成日期:2015年 3 月 13 日
* 版 本 号:v1.0
*
* 问题描述:有一个圆型的旱冰场地,场地内抹水泥,造价为每平方米M元,围栏用木条围成,每米造价N元,输入旱冰场半径,用程序计算出其造价;
* 输入描述:输入半径r ;
* 程序输出:输出总造价。
#include <iostream>
using namespace std;
class Bulk
{
private:
double length;
double width;
double heigth;
public:
void volume();
void areas();
void set_in();
};
void Bulk::volume()
{
cout<<"体积是:"<<length*width*heigth<<endl;
}
void Bulk::areas()
{
cout<<"周长是:"<<2*(length*width+length*heigth+width*heigth)<<endl;
}
void Bulk::set_in()
{
cin>>length>>width>>heigth;
}
int main()
{
Bulk t1,t2,t3;
t1.set_in();
t1.volume();
t1.areas();
t2.set_in();
t2.volume();
t2.areas();
t3.set_in();
t3.volume();
t3.areas();
return 0;
}