Assignment: Object-Oriented Design Cd / Dvd System

Only available on StudyMode
  • Download(s) : 465
  • Published : April 19, 2011
Open Document
Text Preview
Object-Oriented Design

In the object-oriented design for the CD and DVD medial collection system we need to identify the information about the media we are making a system. In the CD and DVD media system we need the name or normally called title of the CD/DVD, its track length, genre information and the ratings of the CD/DVD. Other than this some general information also needed to make system working efficiently. Item

CD
DVD

In this media collection we needs an Item class which keeps general information about the media and the another class which handle the unique information about the media which we are going to use. For example here Item class handles the name of the CD/DVD; its type’s means either CD or DVD and the quantity of this product in the system. So its * Attributes are: Name, Type and Quantity.

* Methods are: SetName, GetName, SetType, GetType, SetQuantity and GetQuantity. Class Item
Name As String
Type As String
Quantity As Integer

Subprogram NewItem(NewName)
Call SetName (NewName)
Call SetQuantity(Quantity + 1)
End Subprogram
Subprogram SetName(NewName)
Set Name = NewName
End Subprogram
Subprogram SetType(NewType)
Set Type = NewType
End Subprogram
Subprogram SetQuantity(NewQuantity)
Set Quantity = NewQuantity
End Subprogram
Function GetName() As String
Set GetName = Name
End Function
Function GetType() As String
Set GetType = Type
End Function
Function GetQuantity() As Integer
Set GetQuantity = Quantity
End Function
End Class

Class CDMedia As Item
Length as Real
Genre as String
Rating as String
Subprogram NewCDMedia (NewLength, NewGenre, NewRating)
Call SetLength(NewLength)
Call SetGenre(NewGenre)
Call SetRating(NewRating)
End Subprogram
Subprogram SetLength(NewLength)
Set Length = NewLength
End Subprogram
Subprogram SetGenre(NewGenre)
Set Genre = NewGenre
End Subprogram
Subprogram SetRating(NewRating)
Set Rating = NewRating
End Subprogram
Function GetLength() As Real
Set...
tracking img