*
* Copyright and version Statement of the procedure
* Copyright (c) 2012, Yantai University Computer College student
* all rightsreserved.
* File name: Volume.cpp
* Author: Sun Rui
* Completion date: 2013 3 Month 25th
* Version number: v1.0
* Input Description: No
* problem Description: Need to find 3 cuboid volume
* Program output: 3 volume numerical Value
*/
#include <iostream>
using namespace std;
Class T
{
private:
int length;
int width;
int height;
Public:
void set ();
void volume ();
};/ /Don't forget the semicolon
int main ()
{
int i=0;
Do
{t
t;
T.set ();
T.volume ();
i++;
} while (i<=2);//loop structure, control three times input return
0;
}
class definition function
void T::set ()
{
cout<< "long:";
cin>>length;
cout<< "Wide:";
cin>>width;
cout<< "High";
cin>>height;
}
void T::volume ()
{
cout<< "the volume of the cuboid is:" << (length*height*width) <<endl;
}
The program runs as follows: