Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
In this video, we'll introduce our first challenge—adding classes to our Media Library program.
Prerequisites
This practice session assumes that you've completed stage 1 of the C# Objects course. If you haven't done that yet, go check it out, then come back to this workshop.
Instructions
1st Challenge
- Add at least two classes to your program—one class for each type of item—or media type—that can be added to your media library.
- Define each class using the
class
keyword within its own C# code file. - Use "Treehouse.MediaLibrary" for the namespace.
- Define each class using the
- Add at least two public fields to each media type class that you added in step #1.
- Each field definition should include an access modifier, a data type, and a name.
Media Type Ideas
Here are some ideas for media types (and fields) that you could define classes for:
- Album
- Title
- Artist
- Release Date
- Label
- Format
- Genre
- Audio Book
- Title
- Author
- Publisher
- Publish Date
- Length
- Format
- Genre
- Performed By
- Book
- Title
- Author
- Publisher
- Publish Date
- Page Count
- Format
- Genre
- eBook
- Title
- Author
- Publisher
- Publish Date
- Page Count
- Format
- Genre
- Movie
- Title
- Director
- Release Date
- Actors
- Producers
- Editor
- Studio
- Genre
- Length
- Video Game
- Title
- Published
- Developers
- Platform
- Series
- Genre
Help
If you get stuck on any of the following topics or simply need a refresher, click on a topic in list below to view the associated video in the C# Objects course.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up