Help with get and set methods

Hey everyone. I am supposed to create a program that finds the area of a triangle...this i can do fine. My only problem is i was told that i need to use a get and set method to calculate the area. I dont exactly know how to use a get and set method with an object...would anybody show me how to do this or set me in the right direction? here is what i have, which works:

I suppose that what you should do is declare base, height and area outside the method, that is, as fields of the object. Then you can have the accesor methods (get) and the mutator methods (set) like this: