bucket - { MySize = Object.MySize; MyAmount =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// bucket.h / #ifndef _BUCKET_H #define _BUCKET_H # const double WEIGHT_OF_WATER = 8.3; c class bucket { public: // constructors bucket(); bucket(bucket & Object); // member functions void SetGallonSize(double Size); void FillBucket(double Amount); double GetWeight(); private: // data double MySize, MyAmount; }; } bucket::bucket() { MySize = 0; MyAmount = 0; }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { MySize = Object.MySize; MyAmount = Object.MyAmount; } void bucket::SetGallonSize(double Size) { MySize = Size; } void bucket::FillBucket(double Amount) { if(Amount <= MySize) { MyAmount = Amount; } else { MyAmount = MySize; } } double bucket::GetWeight() { return(MyAmount*WEIGHT_OF_WATER); } } #endif...
View Full Document

This note was uploaded on 06/20/2011 for the course COMPUTER 12 taught by Professor Aymanboghdady during the Spring '11 term at American College of Computer & Information Sciences.

Page1 / 2

bucket - { MySize = Object.MySize; MyAmount =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online