I need to generate an object oriented design for a system that keeps track of a DVD and CD collection. Identify each of the classes, associated data, and operations of the classes. Create the pseudo code for each of the classes and draw a GUI that will create the objects and provide access to each of the objects processing methods.
Anyone who can help, Thanks a great deal. I have been in over my head the entire class, but when I found out that I could not understand the information provided it was too late to transfer out.
To generate an object-oriented design for a system that keeps track of a DVD and CD collection, we can start by identifying the classes, their associated data, and operations. Here's an example design:
1. Class: MediaItem
- Data: title, releaseYear, genre
- Operations: getDetails()
2. Class: DVD (inherits from MediaItem)
- Data: duration, director
- Operations: play()
3. Class: CD (inherits from MediaItem)
- Data: artist, numTracks
- Operations: play()
4. Class: Collection
- Data: items (list to store DVD and CD objects)
- Operations: addItem(), removeItem(), searchItem(), displayCollection()
Now, let's create the pseudo code for each of the classes:
1. MediaItem:
```
class MediaItem
title
releaseYear
genre
constructor(title, releaseYear, genre)
this.title = title
this.releaseYear = releaseYear
this.genre = genre
method getDetails()
return "Title: " + this.title + ", Release Year: " + this.releaseYear + ", Genre: " + this.genre
```
2. DVD:
```
class DVD extends MediaItem
duration
director
constructor(title, releaseYear, genre, duration, director)
super(title, releaseYear, genre)
this.duration = duration
this.director = director
method play()
// Implementation of video playback
...
```
3. CD:
```
class CD extends MediaItem
artist
numTracks
constructor(title, releaseYear, genre, artist, numTracks)
super(title, releaseYear, genre)
this.artist = artist
this.numTracks = numTracks
method play()
// Implementation of audio playback
...
```
4. Collection:
```
class Collection
items (empty list)
method addItem(item)
add item to items list
method removeItem(item)
remove item from items list
method searchItem(title)
for each item in items
if item.title equals title
return item
return null
method displayCollection()
for each item in items
print item.getDetails()
```
As for the GUI, it's beyond the scope of a text-based conversation to provide a visual GUI. However, you can use a programming framework or tool like JavaFX, Tkinter (Python), or Windows Forms (C#) to create a graphical interface that can create objects, call methods, and display the collection.
Remember, this is just one possible implementation. You can further enhance the design and add more features as per your specific requirements.