Posted on

Axia IT 210 Week 8 Assignment Object-Oriented Design Solution

Assignment: Object-Oriented Design Cd / Dvd System

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 GetLength = Length

 End Function

 Function GetGenre() As String

 Set GetGenre = Genre

 End Function

 Function GetRating() As String

 Set GetRating = Rating

 End Function

 

End Class

 

Class DVDMedia As Item

 Length as Real

 Genre as String

 Rating as String

 Subprogram NewDVDMedia (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 GetLength = Length

 End Function

 Function GetGenre() As String

 Set GetGenre = Genre

 End Function

 Function GetRating() As String

 Set GetRating = Rating

 End Function

 End Class

 

Another class called CDMedia class inherits the class Item, so CDMedia is a Subclass of the Item Super class. This class inherits all the three attributes and the all six methods of the super class. Other then this it also contains the following members in its design.

   * Attributes are: Length, Genre and Rating.

   * Methods are: SetLength, GetLength, SetGenre, GetGenre, SetRating and GetRating.

 So this Media class contains total six attributes and twelve methods in its design. The DVDMedia class contains the similar design as the CDMedia class has; so we are not going to elaborate the DVDMedia class.

 The following GUI will be used to demonstrating the Media Collection System.

     My Media Collection

 

Add Media

 Name:

 Length:

 Genre:

 Rating:

 Reset

 Select Media

 Enter the Following Media Information

CD

 DVD

Leave a Reply

Your email address will not be published. Required fields are marked *