Item
CD
DVD The media collection needs to have a item class to keep the general information about the media and a class to handle the media to is going to be used.
Attributes are: Name, type and quantity.
Methods are: Set name, get name, set type, set quantity and get quantity
Class item
Name as string
Type as string
Quantity as integer
Sub program new item (New name)
Call set name (New name)
Call set quantity (Quantity + 1)
End subprogram
Subprogram set name (New name)
Set name = New name
End subprogram
Subprogram set type (New type)
Set type= New type
End subprogram
Subprogram set quantity (New quantity)
Set quantity = New quantity
End subprogram
Function get name () as string
Set get name = Name
End function
Function get type () as string
Set get type = Type
End function
Function get quantity () as integer
Set get quantity = Quantity
End function
End class
Class CD media as item
Length as real
Genre as string
Rating as string
Subprogram new CD media (New length, new genre, new rating)
Call set length (New length)
Call set genre (New genre)
Call set rating (New rating)
End subprogram
Subprogram set length (New length)
Set length = New length
End subprogram
Subprogram Set genre (New genre)
Set genre= New genre
End subprogram
Subprogram set rating (New rating)
Set rating = New rating
End subprogram
Function get length () as