We are not here to do YOUR homework for you. We are here to help with specific problems you encounter when YOU do YOUR homework and run into some specific trouble that, after doing some googling, you just can't seem to fix.
But if you really want some pseudo code...
Here is some for the cans of paint in VB (because you were to lazy to even specifiy a language!)
Public Class Room
Public Property Walls As IEnumerable(Of Wall)
Public Function GetNumberOfPaintCans As Integer
End Function
End Class