Hi everybody,
i got an error during compiling(Line 34)...the compilier says:
"error C2146: syntax error : missing ';' before identifier 'VolumeOfPool'"
here is my program:
Thanks for helpingCode:#include <iostream.h> class SwimmingPool { private: int length; int width; int depth; float volume; float capacity; float time; float VolumeOfPool(); float CapacityOfPool(); float TimeToFill(); public: SwimmingPool(); SwimmingPool(int,int,int); void displayStat(); ~SwimmingPool(); }; SwimmingPool::SwimmingPool() { length=0;width=0;depth=0; } SwimmingPool::SwimmingPool(int l, int w, int d) { length=l; width=w; depth=d; } float::SwimmingPool VolumeOfPool() //LINE 34 { volume=length*width*depth; return (volume); } float::SwimmingPool CapacityOfPool() { const float PERGALLON = 7.48; capacity=PERGALLON*volume; return (capacity); } float::SwimmingPool TimeToFill () { time = capacity/50; return (time); } void::SwimmingPool DisplayStat () { cout<<"lengh is :"<<length; cout<<"width is :"<<width; cout<<"depth is :"<<depth; cout<<"volume is : "<<VolumeOfPool(); cout<<"Capacity is: "<<CapacityOfPool(); cout<<"Time is: "<<TimeToFill(); } int main() { SwimmingPool d1(10,6,4); d1.DisplayStat(); SwimmingPool d2(30,15,6); d2.DisplayStat(); return 0; }



LinkBack URL
About LinkBacks


