Design a class ReadingMaterials where all reading materials have number of pages
ID: 3527206 • Letter: D
Question
Design a class ReadingMaterials where all reading materials have number of pages, year of publication and title. These values can be passed as parameters into the constructor. Also, make sure you have the following methods: getNumberOfPages, setNumberOfPages, getPublicationYear, setPublicationYear, getTitle, setTitle and toString. Design and implement a set of classes that define various types of readings: novels, textbooks and newspapers. All specific types of reading materials need a toString method that builds upon the toString method in ReadingMaterials. Novels will have a main character, an author and a setting, which will be passed into the constructor. The Novel class will need getMair.Character, setKair.Character, getAuthor, setAuthor, getSetting and setSetting. Textbooks will have a subject, author and number of pages to read, which will also be passed through the constructor. Instead of keeping track of the number of pages in a textbook, the Textbook class will override number of pages from ReadingMaterials and use that data to store how many pages need to be read for an assigned reading. So, textbooks will need getSubject, setSubject, getAuthor, setAuthor, getNumberOfPages and setNumberOf Pages. Finally, newspapers will have number of articles, issue number and volume number, which is to be passed through the constructor. So, the Newspaper class will need getNumberOfArticles, setNumberOfArticles, getlssue, setlssue, getVolume and setVolume. Hint: Make sure you put shared variables and methods into Readir.gMaterials. Be sure to comment all methods and instance data. Use super where applicable. Write your own unit tests similar to those done in your lab and print off your results for submission.Explanation / Answer
http://www.programmersheaven.com/mb/java/282343/282343/college-girl-needs-help-with-java-homework/
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.