[Solved]Java Programming Project 4 Part 1 70 Going Design Build Class Hierarchyl Class Hierarchy N Q37025935



Java Programming Project #4 Part 1 (70%) You are going to design and build your own class hierarchyl In your class hierarchy, you will need to utilize all of the concepts that we are learning about in Module 4. You will also write a test harness class that will demonstrate all of the functionality in your class hierarchy Don’t panic! This may seem like a lot, but it will be very manageable once you get started, which I encourage you to do early. More details follow Your class hierarchy must include (examples refer to the diagram) At least one superclass (class Item in the example below) At least two subclasses that derive from your superclass (Produce and Book) At least two more subclasses that derive from the superclass layer above (Fruit . and Dairy, or Textbook and Audiobook) This is a minimum of five classes in your inheritance hierarchy! Use the diagram in Activity 11.1.3 in your zyBook as a guide Inheritance tree Item Produce Book Dairy Textbook Audiobook rui I am not going to provide any other examples because I want you to think about, design and implement your own set of related classes! However, if you send me your ideas, I will happily respond and let you know whether or not you are on the right track!!! Include a diagram like this one to help me understand what you are planning As you consider your class hierarchy, you should be thinking about “IS A” relationships Is it logical to say Book IS A Item? Produce IS A Item? Fruit IS (A) Produce? Textbook IS A Book? If the answers are yes, then you’re on the right track! Really stuck? Typing “example of inheritance hierarchy” into a Google Image Search might get you heading in the right direction You must also include At least one abstract class (this could be one of the five classes already mentioned above, or it could be another class – up to you!) o Your abstract class must contain at least one abstract method At least one interface (an interface is not a class, but it looks a lot like one) Your interface must contain at least one abstract method o You must extend your abstract class, and you must implement your interface Each class must contain the following At least two fields .Setters and getters for all fields At least one constructor (WHEN POSSIBLE – when will this not be possible?) . An overridden toString) method this should output something useful about objects instantiated from this class Whatever else you need or want to include for your classes to be functional . Your test harness class must demonstrate the functionality of your class hierarchy. You should be instantiating objects of all possible classes and calling at least one method with each object. Call your overridden toString) methods to print something useful about each object. Demonstrate runtime polymorphism. Et cetera Note that your test harness class will not be part of your class hierarchy, but rather will interact with it. The test class is the only class that will have a main method!!! This is a sixth required class that you must include in your project. Part 11 (10%) Describe the differences between abstract classes and interfaces. Give an example of where you might use an interface in a program. Give a example of where you might use an abstract class in a program. Part III (20% In your own words, explain the following object-oriented programming principles abstraction . encapsulation inheritance . polymorphism I encourage you to use your text and any other resources you like to research these concepts. However, I am looking for you to explain these concepts in your own words. If you are leaning heavily on one or more sources, I encourage you to cite those sources. Please don’t submit someone else’s words and claim them as vour own! Deliverable(s) Source code for part I – this will be several classes! (at minimum, six classes and an interface, right?) Paste all the code into a Word document, and also zip up your source code folder and submit it via Canvas. Don’t know how? ASK ME! Screenshot(s) of your project running on your machine. This will be the output that is generated by your test harness class. Paste these screenshots into your Word document as well Answers to parts Il and III. You guessed it… write them in the Word document. Rubric Part I-source code following programming best practices to include: | 70% 20% 10% At least five classes with sensible inheritance hierarchy Classes contain all required components At least one class is abstract 5% Abstract class is extended by at least one other class 5% At least one interface 5% Interface is implemented by at least one class 5% Test class demonstrates all functionality. This includes at a minimum, and is not limited to instantiation of objects . calling setters and getters . at least one example of runtime polymorphism . calling toString0 methods . demonstrating the equals methoo 20% Part II-original thought, thorough, accurate discussion of concepts | 10% Part III – original thought, thorough, accurate discussion of concepts 20% This project is tough, but you have all the knowledge and all the tools, you just need to put it all together! Start early, and please, reach out to me early if you need guidance I am here and willing to help you!!! Show transcribed image text Java Programming Project #4 Part 1 (70%) You are going to design and build your own class hierarchyl In your class hierarchy, you will need to utilize all of the concepts that we are learning about in Module 4. You will also write a test harness class that will demonstrate all of the functionality in your class hierarchy Don’t panic! This may seem like a lot, but it will be very manageable once you get started, which I encourage you to do early. More details follow Your class hierarchy must include (examples refer to the diagram) At least one superclass (class Item in the example below) At least two subclasses that derive from your superclass (Produce and Book) At least two more subclasses that derive from the superclass layer above (Fruit . and Dairy, or Textbook and Audiobook) This is a minimum of five classes in your inheritance hierarchy! Use the diagram in Activity 11.1.3 in your zyBook as a guide Inheritance tree Item Produce Book Dairy Textbook Audiobook rui I am not going to provide any other examples because I want you to think about, design and implement your own set of related classes! However, if you send me your ideas, I will happily respond and let you know whether or not you are on the right track!!! Include a diagram like this one to help me understand what you are planning As you consider your class hierarchy, you should be thinking about “IS A” relationships Is it logical to say Book IS A Item? Produce IS A Item? Fruit IS (A) Produce? Textbook IS A Book? If the answers are yes, then you’re on the right track! Really stuck? Typing “example of inheritance hierarchy” into a Google Image Search might get you heading in the right direction
You must also include At least one abstract class (this could be one of the five classes already mentioned above, or it could be another class – up to you!) o Your abstract class must contain at least one abstract method At least one interface (an interface is not a class, but it looks a lot like one) Your interface must contain at least one abstract method o You must extend your abstract class, and you must implement your interface Each class must contain the following At least two fields .Setters and getters for all fields At least one constructor (WHEN POSSIBLE – when will this not be possible?) . An overridden toString) method this should output something useful about objects instantiated from this class Whatever else you need or want to include for your classes to be functional . Your test harness class must demonstrate the functionality of your class hierarchy. You should be instantiating objects of all possible classes and calling at least one method with each object. Call your overridden toString) methods to print something useful about each object. Demonstrate runtime polymorphism. Et cetera Note that your test harness class will not be part of your class hierarchy, but rather will interact with it. The test class is the only class that will have a main method!!! This is a sixth required class that you must include in your project. Part 11 (10%) Describe the differences between abstract classes and interfaces. Give an example of where you might use an interface in a program. Give a example of where you might use an abstract class in a program. Part III (20% In your own words, explain the following object-oriented programming principles abstraction . encapsulation inheritance . polymorphism I encourage you to use your text and any other resources you like to research these concepts. However, I am looking for you to explain these concepts in your own words. If you are leaning heavily on one or more sources, I encourage you to cite those sources. Please don’t submit someone else’s words and claim them as vour own!
Deliverable(s) Source code for part I – this will be several classes! (at minimum, six classes and an interface, right?) Paste all the code into a Word document, and also zip up your source code folder and submit it via Canvas. Don’t know how? ASK ME! Screenshot(s) of your project running on your machine. This will be the output that is generated by your test harness class. Paste these screenshots into your Word document as well Answers to parts Il and III. You guessed it… write them in the Word document. Rubric Part I-source code following programming best practices to include: | 70% 20% 10% At least five classes with sensible inheritance hierarchy Classes contain all required components At least one class is abstract 5% Abstract class is extended by at least one other class 5% At least one interface 5% Interface is implemented by at least one class 5% Test class demonstrates all functionality. This includes at a minimum, and is not limited to instantiation of objects . calling setters and getters . at least one example of runtime polymorphism . calling toString0 methods . demonstrating the equals methoo 20% Part II-original thought, thorough, accurate discussion of concepts | 10% Part III – original thought, thorough, accurate discussion of concepts 20% This project is tough, but you have all the knowledge and all the tools, you just need to put it all together! Start early, and please, reach out to me early if you need guidance I am here and willing to help you!!!
Expert Answer
Answer to Java Programming Project #4 Part 1 (70%) You are going to design and build your own class hierarchyl In your class hiera… . . .
OR

