DSAA204/ BIT 04 Design Of System Using OOP Assignment Answer

pages Pages: 4word Words: 890

Question :

COURSE:Bachelor of IT
Unit:
Data Structures and Algorithms
Unit Code:
DSAA204/ BIT 04
Type of Assessment:
Individual Report
Length/Duration:
N.A.

Course Learning Outcomes addressed:
  1. 1a) To gather, critically analyse, manage and present in meaningful ways information and data

  1. 4a) To monitor, researc and interpret the fast changing and global world of information technology in terms of hardware, networks, software, and tools

-=6

This assessment is an individual Report.

You are designing an inventory system for a company. The company deals in products of two types; house hold items and food items. There are roughly 300 household items and around 200 food items that company needs to keep record of.

The products are stored with relevant information in the system, which includes product type, product name, product price, product manufacturer for house hold items and expiry for food items. Considering the above system, specify the operations that the inventory system will require.

For each of the operations, state and justify the appropriate sorting and searching algorithms. The algorithms that you choose have to be the ones that could be applied on the Data Structures that you have chosen to represent products.

Later, the company has a merger with another company. Together, they have products with around 25,000 household items and 1500 food items.

What changes would you recommend in your original proposed design and why?

Tasks to be completed

Given the above information:

  1. Decide the appropriate variables, keys and ranges to be used in the system. Justify.
  2. The operations that Inventory should support.
  3. Algorithms for the operations that your system should support. Also, justify the choice of algorithms.
  4. Changes for the larger system if any, to be made in the original system. Justify.
Show More

Answer :

Structures and Algorithms     

Code: - DSAA204/ BIT 204

Assessment Task: - The assessment is about a design of system using OOP 

Executive Summary

In this report we gathered the information about the data, how to manage the data for company. In the recent time the global world is changing with vast technology every day. So, while making the inventory it is also important to use efficient technology and hardware products if necessary, for making inventory systems for secure. There must use of good network technology so that no any problems occur while communicating. Data structure and algorithms should have effectiveness.

Introduction

In this report we have designing the Inventory systems for company. There are two types of product is sold by the company. The products are house hold items and food items. In the company approximately 200 food items and 300 house hold items are available and want to keep the record of all the products. It is required to store the proper information of products in the system, which includes the product name, product type, product price and product manufacture for house hold items and expiry date for food items. We the above requirement we have implement the proper algorithms and applied the data structure on the products. There are various algorithms available for keeping record proper. While designing the Inventory systems it is also keep in mind that company later merge another company together having approx. 25000 house hold items and 1500 food items.

Methodology 

As the above requirement for the inventory system design for company for food items and house hold items. We will discuss the methodology used for inventory of system.

There are two methodology used for inventory are: -

  1. Sorting algorithms
  2. Searching algorithms

Sorting algorithms

There are various sorting technique and algorithms is applied to calculate the data structure and its storage. Sorting refers to techniques of arranging and rearranging the data set in descent order. For the above inventory systems, we have to make List for data storage which store the record of data with different field name. Like for house hold items record, there is four field namely, product name, product types, product price and product manufacturing. For sorting purpose one of key have to make unique which locate the list of record. While choosing the sorting algorithms, we select the best sorting. There are two categories of sorting technique: -

  1. Internal sorting
  2. External sorting

There are different complexity of sorting algorithms which determine the running time of function which ‘n’ number of items which are to be sorted. To get the amount of time to sort a list or array of ‘n’ elements. There are different sorting technique are advised to use in different cases and the below is the name of that cases as follows:-

  1. Best cases
  2. Wort cases
  3. Average cases

There are so many types of sorting techniques but in this Inventory systems we used the bubble sort for making the data list sort. It is very efficient sorting for making the array sort. The higher price products will show according to ascending order and that start from 0th element and compare it with starting element. If the 0th element is found bigger than first elements then, swap operations will be performed. (Stack Abuse, 2019)

Bubble sort Algorithm

 If we let consider that the list of an array of n elements. Later we consider that swap function swaps the data in array elements given

Pseudo Code: -

 begin Bubble_Sort(list)

         For all elements of list

               If list[j] > list[j+1]

                   Swap(list[j], list[j+1])

                 end if

            end for

            return list

    end Bubble_Sort

Searching Algorithm

Searching Algorithm is used to check the elements from any data structure where data is stored. The Searching algorithm is divided into two parts: - 

  1. Sequential Search
  2. Interval search
  3. Sequential search: - The best example of the Sequential search is Linear search. The array is traversed sequentially and each element is checked
  4. Interval Search: - This type of searching algorithms is applied only for sorted data. Interval search is more efficient searching algorithm than Linear search. Every time it targets the middle of search structure and divide the search space in half. Example of interval search is Binary search.

Binary Search: - Binary search is applied on the sorted List by dividing the search interval in every half. Starting with the interval cover all array or list. If the value of the search key is small than items in half of interval, lower half narrow interval is applied. The binary search is take the information that list or array is sorted and reduce the time complexity to O(Log n). (www.javatpoint.com, 2019)

Pseudo Code: 

begin compStr(String1 , String2)

i = 0;

While (String1 [j] == String2 [i] && String1 [j] != '\0')

j++;

end While 

    If (String1 [j] > String2[j]) 

        return -1; 

end If

    return (String1 [j] < String2[j]); 

end compStr 

begin Binary_Search (listOfProduct, toSearch, start , end)

If start > end

          retunn -1

       end If

middle = start + end / 2 

      if listOfProduct[mid] is Empty

 left = mid - 1; 

        right = mid + 1;

        while (true): 

            If left < start && right > end

                return -1; 

 End If

            If right<=end && !listOfProduct[right] isEmpty

                mid = right; 

                break; 

            End If 

            if  left>=start  && !listOfProduct[left].isEmpty

                mid = left; 

                break; 

            End If 

            right++; 

            left--; 

        End While 

      end If 

if   compStr (str, listOfProduct [mid]) == 0

        return mid; 

end If

 if  (compStr (str, listOfProduct [mid]) < 0) 

        return Binary_Search (arr, str, mid+1, end); 

end If

  //search is small than mid 

    return Binary_Search (listOfProduct, start, str, mid-1); 

      end Binary_Search

 Binary search has following complexity: -

  1. Worst case à O(log n)
  2. Best case à O(1)
  3. Average case àO(log n)

List of Data Structure: - 

  1. List: - It is a sequential data structure which different from the queue and stack data, structure in additions and removals will be made at any position of the list.
  2. List of data Structure: - List of data structure performed various operation like, Add, Remove, set the value.
  3. Storing a list in static data structure: - list are stores in the array. The position of all index is considered as 0 to n-1 where n is the number of the elements.
  4. Storing a list in dynamic data structure: - Sequence of linked nodes is used as to store the link list. The link list shrinks as needed and can grow. In the dynamic also the position is given by index from 0 to n-1, where n is the number of elements. (Codechef.com, 2019)

 Data structure implementation for inventory system

we will take a list to store data i.e. for household and food, and household and food have some attributes so to store all of its attribute values need a list of structure that have attributes for household and food.

Structure householdsItems {

Double householdprice,

String householdname,

String householdtype,

String householdmanufacturing 

}

Structure foodItems{

Double foodprice,

String foodname,

String foodtype,

String foodmanufacturing,

Date expDate

}

after declaring this structure for both we need to store all roughly 300 household and around 200 foods by using for loop.

For HuseholdsItems

for i =0 ; i<300; i++:

   householdsItems[i].householdprice = houseHoldPrice;

    householdsItems [i].householdname= houseHoldName;

    householdsItems[i].householdtype = houseHoldType;

    householdsItems[i]. householdmanufacturing =houseHoldManuf

end for

For FoodItems

 for j=0; j<200; j++:

      foodItems[j].foodprice = foodPrice;

      foodItems[j].foodname = foodName;

      foodItems[j].foodtype = foodType;

      foodItems[j].foodmanufacturing = foodManuf;

      foodItems[j].expDate = foodExpDate;

end for

The Data structure has been explained above to keep record of data in list. Two structure has been defined for storing data. The first one is householdsItems and foodItems. As we making the inventory systems for company to keep records of items so that there should not any problems occurs while giving to the customers. For the same we have defined all the data types and variables with ranges. We have implemented the bubble sort for sorting algorithm for sorting the list of arrays. This sort will perform in ascending order and one of the items should have unique value so that sort will be easy and efficient. The same for searching algorithms. We have used the Binary search for the inventory. The binary search has already explained above. The data structure which is declared above is covered all the concept of object-oriented programming. Company has only 300 Household Items and 200 Food items so there are no any problems for storing data from above data structure mentioned.

 Operation that Inventory Support: -

This the company who sold the household items and food items to customers. So Inventory design for selling product is one of the issue. To overcome with issues, we have made the software with best technology implemented on it.  Now a day’s inventory management application is more important. Explosion of inventory related technology stands that more inventory management application on the market. While designing the inventory there should also keep in mind that how much users want to use the desire application. What types of database is required to keep it safe. We have made inventory to think about its future use and present scenario. Budget is one of the problems for the choosing the inventory. The inventory which We made supports search of product name, product price and its types for household items and for food items it also supports expiry date. If the product is about to expiry then it gives the warning to remove the expiry products from the record. As food items usual have mostly expiry date-based products. (Paul Trudgian Ltd, 2019)

Algorithms for operations that system should support

We all have well defined the data structure and used the most efficient algorithms for data to store. The same is explained above. We used the Bubble sorting Algorithms for sort the list of arrays where data is store and binary search.

Algorithms for search of the items.

Justifying the appropriate sorting and searching algorithms for the above inventory system. We have stored all the products in structure of list for household Items and foodItems, now for sorting and searching we use bubble sort for list of string based on householdItem_Name, and for foodItems. And binary search for both of them because of sorted list of string. We have explained algorithm for bubble sort and binary search above. These algorithms are most efficient algorithms for making the inventory more efficient.

Recommendation for larger systems: - 

In the above scenario company also planning to merge with another company having 25000 house hold items and 1500 food items. The Data is larger. But in above inventory we have made for small amount of storing data. If the company merge then we should have to change the sorting algorithms. The sorting algorithms we suggest for merge sorting. It is generally used for larger data store in list of arrays. The above inventory is scalable so we can change the structure of Data store and redesign the inventory again for larger data using new algorithms. The technology used for inventory is first-in-first-out methods which involves the selling of the older items from company. (InterviewBit, 2019)

Conclusion

We have designed the inventory for company whose purpose is to sell the products. In the first instance it is for small data for later company shifted with another company having large data in their warehouse. While designing the inventory we concentrate on the data structure algorithms and its efficiency. Data structure plays important role in the inventory systems design. The company has always priority to serve their customer quick. Since what we made inventory is scalable and easy to use. Also decrease the complexity by using various technology so that company never face problem. The technology what we used is first-in-first-out so that older product sold first.