Reputation: 13
I've put together this class so far but the last required step is to add a method that will display all of the practical info (I.E. the size, style and color) to the class itself.
I would typically just do this by setting up and calling a module outside of the class but for this project I am not allowed to do so.
Here's what I've got so far (I don't have the module main or any other modules set up just yet as I am hung up on this particular issue):
Class Sweater
Private Real sweaterSize
Private String sweaterStyle
Private String sweaterColor
Public Module Sweater()
Set sweaterSize = 0
Set sweaterStyle = " "
Set sweaterColor = " "
End Module
Public Module Sweater(Real newSweaterSize, String newSweaterStyle, String
newSweaterColor)
Set sweaterSize = newSweaterSize
Set sweaterStyle = newSweaterStyle
Set sweaterColor = newSweaterColor
End Module
Public Module setSweaterSize(Real newSweatersize)
Set sweaterSize = newSweaterSize
End Module
Public Function Real getSweatersize()
Return sweaterSize
End Function
Public Module setSweaterStyle (String newSweaterStyle)
set sweaterStyle = newSweaterStyle
End Module
Public Function String getSweaterStyle()
Return sweaterStyle
End Function
Public Module setSweaterColor (String newSweaterColor)
set sweaterColor = newSweaterColor
End Module
Public Function String getSweaterColor()
Return sweaterColor
End Function
Upvotes: 0
Views: 76
Reputation: 69
You should just be able to create another public function inside the class that calls your accessor methods or the variables themselves. For example
Public Function null display()
Display getSweaterSize()
Display getSweaterStyle()
Display getSweaterColor()
End Function
Upvotes: 0