📄 box.h
字号:
// Box.h Definition of the Box class
#ifndef BOX_H
#define BOX_H
class Box {
public:
// Constructor
Box(double lengthValue = 1.0, double widthValue = 1.0,
double heightValue = 1.0);
// Function to calculate the volume of a box
double volume();
// Inline functions to provide the values of data members
double getLength() {return length;}
double getWidth() {return width;}
double getHeight() {return height;}
// Functions to set data member values
void setHeight(double hvalue) {if(hvalue > 0) height = hvalue;}
private:
double length;
double width;
double height;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -