How can we encapsulate this code?

By putting base, height, and getArea() in the same objectBy putting base and height in the same object

By putting base, height, and getArea() in the same object.