Question
please answer fast. i will upvote. Now know the answer to the second part, and I need to know the answer to the third part,
please answer fast. i will upvote.
Now know the answer to the second part, and I need to know the answer to the third part, and certainly the third part is related to the second part and first part also
Part-III
Search And Select
(Full 50% of your total course grade)
In this last and final part of the course work you are required to change the definition of the Item_in_Stock class to make it an abstract class and change the getItemCat(), getltemName() and getItem Description() definitions to make them abstract methods. You are then required to design and implement three classes which are derived from Item_in_Stock class to fully demonstrate the concept of inheritance and polymorphism. Implementation of HP Laptop class in part II should have given you an idea of inheritance and polymorphism.
Three sub classes, one class against each
category (Computers, Laptops and Accessories), should contain appropriate constructors, instance variables, setter and getters methods and overridden methods for getItemName(), getItemDescription() and get_Item_details() method.
You should be creative and come up with
your own ideas of sub-classes. Task 3.1. Draw a UML class diagram with
all the classes and relationships.
Task 3.2. Write code in Java with all these classes implementation and a program called Polymorphism works with member method specific_Item which takes one instance of Item_in_Stock class as a parameter. Perform functionality of adding items, selling items and changing item price and displaying items details against specific item instance. There should be a main () method which declares an array of objects containing instance of sub classes of Item_in_Stock class and then calls methods of each of the implemented
classes.
Example.
class polymorphism works (
public static void specific_Item(Item_in_Stock OBJ)(
System.out.println("Item
in stock details"); System.out.println(OBJ);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started