Now that you have read the book\'s content and watched the tutorial videos on ob
ID: 3531060 • Letter: N
Question
Now that you have read the book's content and watched the tutorial videos on object-oriented programming and how to define classes with attributes and accessor/modifier(mutator) methods, you should be able instantiate or create objects using a user-defined class(like Song) and invoke accessor/modifier(mutator) methods on an object(like mySong or yourSong). For this assignment, recreate the Song class and main function/program from the video tutorial. Then instantiate/create at least 2 new objects using the Song class in the main method/program, testing all the accessor/mutator methods on these objects. For extra credit: add at least 2 attributes and accessors/modifiers methods for these attributes in the Song class. Requirements Recreate the Song class and main function/program class from the video lesson In the main function/program, create at least 2 more song objects. Set their attributes using the modifier(mutator) methods, and then display the attribute values using the accessor methods For extra credit: Add at least 2 attributes to the Song class, make them private Provide accessors/modifiers methods for these attributes Test all of these methods in the main function/program class Hint/Defnitions: 1. Objects - are entities that have attributes and behaviors(methods) (examples of object variables are mySong, yourSong) 2. Attributes (or instance fields) are characteristics/properties of an object(every object has it's own set of instance fields).. They are defined within a class(examples are title, artist, duration). 3. Accessor methods are used to access or return the value of a private attribute/instance field (examples are getTitle, getArtist, getDuration). 4. Modifier methods (or mutator methods) are used to alter or change a private attribute/instance field (examples are setTitle, setArtist, setDuration) The purpose of this exercise is to give you practice with the object-oriented programming concepts of creating/instantiating objects from a user defined class, and using mutator/accessor methods.Explanation / Answer
You'll need to link us to the mentioned tutorial for us to recreate it
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.