Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part-III (Full 50% of your total course grade) In this last and final part of the course work you are required to change the definition

image text in transcribed
image text in transcribed
Part-III (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(), getItemName() 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 Sony TV class in part II should have given you an idea of inheritance and polymorphism. Three sub classes, one class against each category (Smart Devices, Home Appliances and Games), should contain appropriate constructors, instance variables, setter and getters methods and overridden methods for getItemName(), getItem Description() 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); } public static void main(String[] args) { Item_in_Stock [] Item_list = new Item_in_Stock [3]; Testing is an integral part of development. Write suitable test cases in the given format below for your classes. Test Case Purpose Expected result

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

Why are priority rules needed?

Answered: 1 week ago

Question

an element of formality in the workplace between different levels;

Answered: 1 week ago