public static void Main()
Console.WriteLine("Hello World");
private double currentAmount ;
public Bucket ( string caption, int capacity, double currentAmount )
this.currentAmount=currentAmount;
public string GetCaption()
public double GetCurrentAmount()
return this.currentAmount;
public void SetCaption(string caption)
public void SetCapacity(int capacity)
this.capacity = capacity;
public void SetCurrentAmount(double currentAmount)
this.currentAmount = currentAmount;
this.currentAmount = this.currentAmount;
return this.currentAmount == 0;
public void Fill(double amountToFill)
if(this.capacity < amountToFill)
this.currentAmount = this.capacity;
this.currentAmount = amountToFill;
public void pourInto(Bucket bucketInto)
if(BucketInto.currentAmount += this.currentAmount)
this.currentAmount += bucketInto.currentAmount;
bucketInto.currentAmount = 0;
this.currentAmount = this.capacity;
bucketInto.currentAmount = bucketInto.currentAmount;
public override string Tostring()
return string.Format("the capacity = {0}/n The currentAmount of water = {1}",this.capacity, this.currentAmount);