in C# pls Introduction: A codec, short for Coder/Decoder, is a program which is used to convert
Question:
in C# pls
Introduction:
A “codec”, short for “Coder/Decoder”, is a program which is used to convert audio and/or video information from one format into another. Originally, codecs were conceived to convert analog signals into digital information for storage in computers, and then back again into analog during media playback. Nowadays, several different libraries are available which implement these codecs, enabling programs to read music or video files. Codecs may be created with specific goals in mind, such as trying to minimize the amount of space a piece of media occupies on disk, encoding image motion at the expense of color accuracy, or vice-versa. They usually implement some sort of mathematical concept to achieve its goals (e.g.: Discrete Cosine Transform). In this assignment, we’ll simulate a very simple library which stores information on the media files it receives, including its name, its type, and any codecs it may need. These media files may be either images, music, or videos, and will follow a fictional industry standard, which will be implemented through interfaces. (It’s worth noting that image files don’t actually have codecs but, instead, have file formats which dictate how the image information must be stored in disk. For the purposes of this assignment, we’ll pretend that images utilize codecs as well.) This assignment will make use of a data structure which in Java is called “Array List” and in C# is called “List”. Going forward, both will be simply referred to as a “list”, for simplicity. This assignment requires that a UML diagram is submitted along with your code. UML diagram entities must contain: • The name of the class • All of the classes’ fields and access levels (types are optional) • All of the classes’ methods (constructors are optional) • Arrows indicating the relationship between classes (i.e.: parent and child) Requirements The features described below must be in your program. • A total of five classes: Driver, Media, Image, Music, and Video • A total of 3 interfaces: IMediaStandard, IAudioStandard, and IImageStandard • Interface IMediaStandard has a single method called “getMediaInfo()”. It takes no parameters and returns a string. • Interface IAudioStandard is a sub-interface of IMediaStandard and has a single method called “getAudioCodec()”. It takes no parameters and returns a string. • Interface IImageStandard is a sub-interface of IMediaStandard and has a single method called “getImageCodec()”. It takes no parameters and returns a string. • Media must be abstract and have the following private fields: o A string field named fileName; o An integer field named id; o A static integer field named nextId; • Media must have the following constructors: o The default constructor sets id to nextId and increments nextId by one. o The overloaded constructor takes a String which is used to set fileName. It then sets id to nextId and increments nextId by one. • Media must have getters for fileName and id. • Image is a subclass of Media, must implement IImageStandard, and must have the following private field: o A string named imageCodec. • Image must have an overloaded constructor which takes in a String name and a String imageCodec. It must call its parent constructor and pass it “name”, while setting its imageCodec field with the one in the parameters. • It must implement getImageCodec(), which returns the following string: Image codec: [IMAGE_CODEC_FIELD] • It must implement getMediaInfo(), which returns the following string: Image ID: [ID] Image name: [NAME] Image codec: [IMAGE_CODEC_FIELD] • Music is a subclass of Media, must implement IAudioStandard, and must have the following private field: o A string named audioCodec • Music must have an overloaded constructor which takes in a String name and a String audioCodec. It must call its parent constructor and pass it “name”, while set its audioCodec field with the one in the parameters. • It must implement getAudioCodec(), which returns the following string: Audio codec: [AUDIO_CODEC] • It must implement getMediaInfo(), which returns the following string: Music ID: [ID] Music name: [NAME] Audio Codec: [AUDIO_CODEC_FIELD] • Video is a subclass of Media, must implement IImageStandard and IAudioStandard, and must have the following private fields: o A string named imageCodec. o A string named audioCodec. • Video must have an overloaded constructor which takes in a String name, a String imageCodec, and a String audioCodec. It must call its parent constructor and pass it “name”, while setting its imageCodec and audioCodec fields with the ones in the parameters. • It must implement getImageCodec(), which returns the following string: Image codec: [IMAGE_CODEC_FIELD] • It must implement getAudioCodec(), which returns the following string: Audio codec: [AUDIO_CODEC_FIELD] • It must implement getMediaInfo(), which returns the following string: Video ID: [ID] Video name: [NAME] Image Codec: [IMAGE_CODEC_FIELD] Audio Codec: [AUDIO_CODEC_FIELD] • The Driver must create a List of Media called allMedia. It must then run a menu in a loop with the following options: o Add image: Prompts for a name and an image codec. Creates an instance of an Image with the information prompted and adds it to allMedia. o Add music: Prompts for a name and an audio codec. Creates an instance of a Music with the information prompted and adds it to allMedia. o Add video: Prompts for a name, an image codec, and an audio codec. Creates an instance of a Video with the information prompted and adds it to allMedia. o Show images: Traverses allMedia, calling getMediaInfo() only on instances of Images. o Show music: Traverses allMedia, calling getMediaInfo() only on instances of Music. o Show videos: Traverses allMedia, calling getMediaInfo() only on instances of Videos. o Show images and videos: Traverses allMedia, calling getMediaInfo() only on instances of objects which implement IImageStandard. o Show music and videos: Traverses allMedia, calling getMediaInfo() only on instances of objects which implement IAudioStandard. o Exit: Terminates the program. Considerations • Remember that you will get partial credit for partial work. Try to deliver as much of the assignment as you can. • You may add any helper methods you believe are necessary, but you will not get points for them. • Remember to make full use of inheritance to avoid writing the same lines of code multiple times. • Proper casting will be necessary to call some of the methods.
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill