Please provide the whole CODE of my qustion base on the Below codes  Part 1 code : import java.util.Scanner;   public class ItemInStock { private String itemCode; private String itemName; private String itemDescription; private int quantity; private double itemPrice; private String item_category;   public ItemInStock(String itemCode, int quantity, double itemPrice) { this.itemCode = itemCode; this.quantity = quantity; this.itemPrice = itemPrice;   }   public String getItemCode() { return this.itemCode; }   public void setItemCode(String itemCode) { this.itemCode = itemCode; }   public String getItemName() { return this.itemName; }   public void setItemName(String itemName) { this.itemName = itemName; }   public String getItemDescription() { return this.itemDescription; }   public void setItemDescription(String itemDescription) { this.itemDescription = itemDescription; }   public int getQuantity() { return this.quantity; }   public void setQuantity(int quantity) { this.quantity = quantity; }   public double getItemPrice() { return this.itemPrice; }   public void setItemPrice(double itemPrice) { this.itemPrice = itemPrice; } public String getItem_category() {   return item_category ;   }       public void setItem_category(String item_category) {   this.item_category = item_category;   }     public void addItem() { if (this.quantity + 1 > 25) { System.out.println("The error: Item stock must not exceed 25 items"); } else { this.quantity++; } }   public void itemSell() { Scanner scanner = new Scanner(System.in); System.out.print("Enter the quantity of items to sell: "); int sellQuantity = scanner.nextInt(); if (sellQuantity > this.quantity) { System.out.println("Error: Not enough items in stock"); } else { this.quantity -= sellQuantity; } }   public double taxOnItem() { return this.itemPrice * 0.05; }   public double getItemPriceWithTax() { return this.itemPrice + this.taxOnItem(); }   public void getItemDetails() { System.out.println("Item Category: " + this.getItem_category()); System.out.println("Item Name: " + this.getItemName()); System.out.println("Description: " + this.getItemDescription()); System.out.println("StockCode: " + this.getItemCode()); System.out.println("Price Without Tax: R. O " + this.getItemPrice()); System.out.println("Price With Tax: R.O " + this.getItemPriceWithTax()); System.out.println("Total quantity in store: " + this.getQuantity()); } }   Part 2 code public class HP_Laptop extends ItemInStock { private String processor; private int memory; private int storage;   public HP_Laptop(String itemCode, int quantity, double itemPrice, String processor, int memory, int storage) { super(itemCode, quantity, itemPrice); this.processor = processor; this.memory = memory; this.storage = storage; }   @Override public String getItem_category() { return "Laptop"; }   @Override public String getItemName() { return "HP Laptop"; }   @Override public String getItemDescription() { return "HP " + processor + " " + memory + "GB " + storage + "GB"; }   @Override public void getItemDetails() { super.getItemDetails(); System.out.println("Processor: " + processor); System.out.println("Memory: " + memory + "GB"); System.out.println("Storage: " + storage + "GB"); } } HeRe is the qustion  In this 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(), getItemName() and getItemDescription() 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 In pic it is the example how it can be start and I am beging you write the whole code for me with all 3 subclass and abstract and use the things asked in qustion plsplsplspla PLS PLS PLS write the code complitly  base on part 1 and 2 code, If I got the answer I will give upvote and good feedback

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please provide the whole CODE of my qustion base on the Below codes 

Part 1 code :

import java.util.Scanner;

 

public class ItemInStock {

private String itemCode;

private String itemName;

private String itemDescription;

private int quantity;

private double itemPrice;

private String item_category;

 

public ItemInStock(String itemCode, int quantity, double itemPrice) {

this.itemCode = itemCode;

this.quantity = quantity;

this.itemPrice = itemPrice;

 

}

 

public String getItemCode() {

return this.itemCode;

}

 

public void setItemCode(String itemCode) {

this.itemCode = itemCode;

}

 

public String getItemName() {

return this.itemName;

}

 

public void setItemName(String itemName) {

this.itemName = itemName;

}

 

public String getItemDescription() {

return this.itemDescription;

}

 

public void setItemDescription(String itemDescription) {

this.itemDescription = itemDescription;

}

 

public int getQuantity() {

return this.quantity;

}

 

public void setQuantity(int quantity) {

this.quantity = quantity;

}

 

public double getItemPrice() {

return this.itemPrice;

}

 

public void setItemPrice(double itemPrice) {

this.itemPrice = itemPrice;

}

public String getItem_category() {

 

return item_category ;

 

}

 

 

 

public void setItem_category(String item_category) {

 

this.item_category = item_category;

 

}

 

 

public void addItem() {

if (this.quantity + 1 > 25) {

System.out.println("The error: Item stock must not exceed 25 items");

} else {

this.quantity++;

}

}

 

public void itemSell() {

Scanner scanner = new Scanner(System.in);

System.out.print("Enter the quantity of items to sell: ");

int sellQuantity = scanner.nextInt();

if (sellQuantity > this.quantity) {

System.out.println("Error: Not enough items in stock");

} else {

this.quantity -= sellQuantity;

}

}

 

public double taxOnItem() {

return this.itemPrice * 0.05;

}

 

public double getItemPriceWithTax() {

return this.itemPrice + this.taxOnItem();

}

 

public void getItemDetails() {

System.out.println("Item Category: " + this.getItem_category());

System.out.println("Item Name: " + this.getItemName());

System.out.println("Description: " + this.getItemDescription());

System.out.println("StockCode: " + this.getItemCode());

System.out.println("Price Without Tax: R. O " + this.getItemPrice());

System.out.println("Price With Tax: R.O " + this.getItemPriceWithTax());

System.out.println("Total quantity in store: " + this.getQuantity());

}

}

 

Part 2 code

public class HP_Laptop extends ItemInStock {

private String processor;

private int memory;

private int storage;

 

public HP_Laptop(String itemCode, int quantity, double itemPrice, String processor, int memory, int storage) {

super(itemCode, quantity, itemPrice);

this.processor = processor;

this.memory = memory;

this.storage = storage;

}

 

@Override

public String getItem_category() {

return "Laptop";

}

 

@Override

public String getItemName() {

return "HP Laptop";

}

 

@Override

public String getItemDescription() {

return "HP " + processor + " " + memory + "GB " + storage + "GB";

}

 

@Override

public void getItemDetails() {

super.getItemDetails();

System.out.println("Processor: " + processor);

System.out.println("Memory: " + memory + "GB");

System.out.println("Storage: " + storage + "GB");

}

}

HeRe is the qustion 

In this 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(), getItemName() and getItemDescription() 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

In pic it is the example how it can be start and I am beging you write the whole code for me with all 3 subclass and abstract and use the things asked in qustion plsplsplspla

PLS PLS PLS write the code complitly  base on part 1 and 2 code, If I got the answer I will give upvote and good feedback 

Example.
class polymorphism_works {
public static void specific_Item(Item_in_Stock OBJ){
System.out.println("Item in stock details");
System.out.println(OBJ);
}
public static void main(String[] args) {
Item_in_Stock [] Item_list = new Item_in_Stock [3];
Transcribed Image Text:Example. class polymorphism_works { public static void specific_Item(Item_in_Stock OBJ){ System.out.println("Item in stock details"); System.out.println(OBJ); } public static void main(String[] args) { Item_in_Stock [] Item_list = new Item_in_Stock [3];
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY