Java: TINY DISTRIBUTORS
Part 1- Done
The application will have two classes, one named customer and another named inventory to represent the attributes captured by the system. Using these classes enables the programmer to visualize the operational features that Tiny Distributors application will require to implement.
Both the customer class and the inventory class are concrete classes. Each of these classes has its methods implemented and hence, they are viewed as concrete classes. This is a better programming concept than when they are abstract as all methods that belong to an individual class are encompassed within it, which provides better transparency into using logical interpretations to solve problems, than when an individual class is abstract. The inventory class inherits from the customer class. The customer class is therefore a superclass while the inventory class inherits from it. Both these classes should implement exception handling to guide the user through errors such as an invalid selection or when incorrect data types are used where input is required. This is a programming culture that provides for fault tolerance, as in some cases, errors are encountered (Nakshatri, Hegde & Thandra, 2016).
The customer class has variables such as customername that captures string type data elements which have a set size of a maximum of twenty characters. The customername variable stores input that relates to the name of the customer. Another variable to be associated with the customer class is the payment mode. This variable stores input that describes the type of payment module used, such as cash, a credit card, or mobile money transfer. The customer class implements a switch statement where the cases identify specific customers, to specifically target individual customer information. This can take a variable of the string type with a maximum of ten characters.
The inventory class has variables such as ProductName which documents the actual product a customer purchases and captures string type data elements with a maximum of thirty characters. Another variable within this class is the quantity variable which is of type integer. This variable stores the number of items purchased which are of one type. The price variable and receipt number variable are also both of type integer. The price variable stores the shelf prices at the stores. The inventory class implements a stack which adds elements in an inventory to the top.
The customer class has the CreateCustomer method which captures entries of a new customer. This method executes a statement that prompts for input. The CreateCustomer method can also print to screen to identify what has been captured form the input prompt. The GetCustomer method allows for printing to screen. It executes a statement that allows for the selection of a customer from a list and the printing of all the details captured about that customer. The ModifyCustomer method allows the user of the application to perform editorial tasks for the created customer records. The PrintReport method converts all the customer information into a logical order from which all the details captured can be analyzed.
The inventory class has the CreateInventory method which allows the user to list all items in the inventory and assign it an inventory number. Like the CreateCustomer class, it also contains both statements to capture input and to print this input on the screen. The GetInventory method projects all inventories and allows the user to lookup information within these inventories after selecting an individual inventory from the list. The ModifyInventory method allows the user to edit the inventories once he selects a particular inventory of interest. The PrintInventory method structures the selected inventory into a logical format for printing to the screen. The PrintOrder method allows the user to view all orders, which constitute the individual items from the inventory. When this method is called, the print function is implemented which describes what items have been purchased as from the inventory.
Part 2
PROJECT: TINY DISTRIBUTORS
OVERVIEW:
Tiny Distributors is a small brick and mortar store that sells various items. The owners feel they are at the point in their growth where they would benefit from a presence on the Internet. They have hired Web developers to create the website and pages, but need a Java developer to create underlying functionality.
The owners have listed the following as the minimum functionality required for this project.
1. The ability to add, modify, and delete customers
2. The ability to add, modify, and delete inventory items
3. The ability to add, modify, and delete customer orders; a customer order is comprised of two parts: the order header and one or more line items
4. The ability to create and print a customer report
5. The ability to create and print an individual customer order
6. The ability to create and print an inventory report listing all inventory items in stock
7. The ability to create and print an order report listing all orders currently open
Although you will not be required to re-submit Phase 1, you may have received feedback for Phase 1 that will affect Phase 2. Please be sure to include any additional information in Phase 2 based on that feedback.
REQUIREMENTS:
You will create the coding needed to complete the functionality for the project. While you will not need to execute the code, all code must be syntactically correct and logically ordered.
1. Write the class definitions for all classes. Be sure to include all properties and methods, including the getters and setters for each class.
2. Write the code to create an object of each type of class created in Part 1. The names of the objects created in this part will be used for further requirements in this phase. Do not populate the properties here; that will be accomplished in Part 3.
3. Write the methods that will populate the properties of each object created in Part 2. For purposes of this part, assume that you have read the data from a flat file into variables for each property in the class. These methods will be used for further requirements in this phase.
4. Write the code to print out an individual customer’s information. Your code must read the customer from a file, populate the object, and display the data from the object.
5. Write the code to print out an order for an individual customer. Your code must read the order header from a file, populate the object, and display the data from the object. Then you must read each line item from a file, populate the object, place the object in a linked list, and display the data by reading from the linked list after all the line items have been added.
6. Write the code to print out a customer report. Your code must read each customer from a file, populate the object, place the object in a linked list, and display the data from the linked list.
7. Write the code to print out an inventory report. Your code must read each inventory item from a file, populate the object, place the object in a linked list, and display the data by reading from the linked list after all items have been added.
8. Write the code to print out an order report. Your code must read each order header from a file, populate the object, place the object in a linked list, and display the information by reading the linked list after all orders have been added.
9. Write the code that will read the inventory information from a file, populate the object, and populate a linked list with all the inventory objects. Then find a particular item in the linked list based on user input and display the information for that item.