Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Section 1: Overview of Assessment This assignment assesses the following module learning outcomes: Demonstrate knowledge of the object oriented (OO) paradigm by producing software solutions

Section 1: Overview of Assessment This assignment assesses the following module learning outcomes: Demonstrate knowledge of the object oriented (OO) paradigm by producing software solutions to simple problems. Design a simple OO system using UML class diagram (without using a formal tool) Implement and test a simple OO software system using a suitable Integrated Development Environment (VS code/NetBeans) Comprehend and explain object-oriented programming concepts Code re-use, apply good practice in code design/testing The assignment is worth 50% of the overall mark for the module. Broadly speaking, the assignment requires you to review the ideas of superclass and subclass relationship and provide opportunities to examine your level of knowledge in basic hierarchical class design and object-oriented programming. The assignment is described in more detail in section 2. This is an Individual assignment. Working on this assignment will help you to understand more clearly the concepts, problems, and techniques of basic object-oriented programming, and how these can be used to design and implement a simple problem. If you have questions about this assignment, please contact/discuss with your lab tutor. Please read the following INSTRUCTION before starting your assignment. This coursework consists of three parts. Completing only Part-I represents 20% of your total course grade, so you will only be awarded partial marks. Competing Part-II (which includes Part-I) represents 30% of your total course grade, and you will still be awarded partial marks. Completing Part-III (which includes Part-I and Part-II) represents full 50% of your total course grade. If you complete Part-III, you do not have to demonstrate Part-I and Part-II separately. If you complete Part-II, you do not have to demonstrate Part-I separately. Part-I (Only 20% of your total course grade) E-TechComputer store in Oman sells different electronics products such as Computers, Laptops and accessories. The store Management requires an automated software to keep track of items in stock and prices. You as a software designer and developer are asked to develop a system for the store. The first task you should carry out is to design and code a class related to stocked Items. You can name this class as Item_in_Stock. The class should consist of the following: A data member Item_code to store an item code e.g, C15, a data member to store item name, a data member to store item description, a data member to store quantity of items in stock and a data member item_price to store price of an item. You must use the appropriate data types and access specifier for each data member. Class should have a constructor that initialises class objects with specified item_code, quantity and price of items. Getter and setters methods for all the data members including getItemCat() method which returns Unknown Item Category, getItemName() method which returns the "Unknown Item Name" and getItemDescription() which returns "Unknown Item Description. These methods will be overridden in later tasks of the assignment to set and display information related to specific items. An add_Item method to add items in stock with a check that item stock does not exceed 25. An appropriate message should be displayed if inserted item exceeds the limit. An item_Sell member method to sell items, method should ask for quantity of selling item and then reduces the stock level accordingly. A tax_on_Item method gives tax on items (Tax is fixed at 5%) A method to set item price without tax and get method to get item price both with and without tax A method named get_Item_Details() that provides Item code, Item Category, Item name, Item description, quantity in stock, and price with and without tax. Task 1.1 Graphically represent above mentioned class in UML by drawing class diagram. Task 1.2. Implementation of the class using Java language. Write a program called Stocked_Item with main () method to test the Item_in_Stock class. Testing is an integral part of development. Write suitable test cases in the given format below for your class. Test Case Purpose Expected result Example OUTPUT: Creating a stock with 5 units Laptops i-5 11g 8gb 1tb, price R.O 180 per item, and item code C15 Laptops item stock information: Item Category: Unknown Item Category Item Name: Unknown Item Name Description: Unknown Item Description StockCode: C15 Price Without Tax: R.O 180 Price With Tax: R.O 189 Total quantity in store: 5 Adding 3 more items Printing item stock information: Item Category: Unknown Item Category Item Name: Unknown Item Name Description: Unknown Item Description StockCode: C15 Price Without Tax: R. O 180 Price With Tax: R.O 189 Total quantity in store: 8 Sold 2 items Printing item stock information: Item Category: Unknown Item Category Item Name: Unknown Item Name Description: Unknown Item Description StockCode: C15 Price Without Tax: R. O 180 Price With Tax: R.O 189 Total quantity in store: 6 Changing price to R.O 200 Printing item stock information: Item Category: Unknown Item Category Item Name: Unknown Item Name Description: Unknown Item Description StockCode: C15 Price Without Tax: R. O 200 Price With Tax: R. O 210 Total quantity in store: 6 Adding 25 more Items The error: Item stock must not exceed 25 items Part-II (Only 30% of your total course grade) In this part of the course work, you are required to design and implement a class called HP_Laptop with instance variables specific to this type of items, a constructor with parameters which initialises class data members and invokes the Item_in_Stock constructor when it is invoked using inheritance concept in java and initialises data members of Item_in_stock class as well. This class should be designed and implemented in a way that it overrides getItemCategory() that returns the category of the item, getItemName() that returns HP_Laptop and getItemDescription() that returns HP_I5_11G_8GB_1TB . The Class should also override the get_item_details() method to display the complete details of an item. Task 2.1. Re-draw UML class diagram which was drawn in part 1 of the course work with this new class HP_Laptop. Relationships should also be represented. Task 2.2. Implement a class called Item_check with a main method to test HP_Laptop class by defining object of the class and invoking methods. Testing is an integral part of development. Write suitable test cases in the given format below for your classes. Test Case Purpose Expected result OUTPUT: Refer to output in part I, item category, item name and item description should be according to the Items. 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 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. 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 i need the code for the part 3 plz

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

Step: 3

blur-text-image

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions