Question: Programming Problem: define a C++ Bucket class with the following methods: Bucket() constructor that takes two parameters, a string name and an int parameter, the
Programming Problem: define a C++ Bucket class with the following methods: Bucket() constructor that takes two parameters, a string name and an int parameter, the bucket capacity. print) takes no paramers. Prints the bucket name, capacity and contents. Returns void. - fill() that takes no parameters, fills the bucket to capacity. Returns void -empty() that takes no parameters, empties the bucket. Returns void. pour _into() takes one parameter, a reference to a Bucket object, returns an int that is the number of gallons transferred. This method pours the calling object Bucket into the parameter object bucket. As much of the first bucket as will fin into the remaining capacity of the parameter bucket is transferred The class will have thee private data members, name, capacity and contents.Name is a string, and is the name of the bucket. Capacity is the size of the bucket, and contents is the amount of water the bucket currently contains
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
