Establishing a class Box, the constructor of the Box is transmitted three Double values, each Double value represents a border of the box. Calculate the volume of the cube with the Box class and store it in a Double variable. A member function Vol () is included in the Box class to display the volume of each Box object.
#include
Class Box {
Double Chang, Kuan, GAO
PUBLIC:
Box A (Double C, Double K, Double G)
{chang = C; kuan = k; gau = g;}
Double Vol ()
{DOUBLE V;
v = chang * kuan * GAO;
Return v;}
}
void main ()
{
Double C, K, G;
Box a (Double C, Double K, Double G);
CIN >> C >> K >> G;
COUT << "v =" <
<
Error message: 3.10.cpp (17): Error C2228: Left of '.vol' Must Have Class / Struct / Union TypeError Executing Cl.exe.
3.10.obj - 1 Error (s), 0 Warning (s)
Why do you say that it is not a Class type, how can I pass,