Class Cube
Calculation of the properties of cubes
Description
The class Cube calculates properties of a cube.
The default argument is the side length \(a\). This means that the side length can be passed as an argument without a command string (see example below).
Properties
The following properties can be queried as a result or passed as an argument.
Symbols
Description
a Length of a side d Diagonal of an area P Perimeter of a side e Space diagonal A Area of a side S Sureface of the cube V Volume of the cube
Syntax
Object = Cube (a)
Object = Cube ("arg names", arguments)
Value = Cube ("get -> arg names", arguments)
Examples
As an argument a side length (default) \(a\) = 4 specified.
As an argument the diagonal \(d\) = 5 is given.
From an initialized object \(a\) only the volume \(V\) is displayed.
The volume \(V\) is calculated from the diagonal \(d\).