Retrieved from https://studentshare.org/information-technology/1395957-software-development-java
https://studentshare.org/information-technology/1395957-software-development-java.
The classes box, cylinder, triangular are illustrated at the bottom with connections to the calculateCost class which is the parent class. The working methods illustrate the functionalities/purposes of the different classes. The underived class checkStock has not been derived or linked to any child classes, and therefore, it has been shown separately with its data members and method members.
The class hierarchy diagram hierarchically shows the 5 classes with the superclass/parent class/base class on top i.e., the class calculateCost. The child classes are shown at the bottom and they have been labeled as implementing classes with definitions of the member methods of the parent class. The superclass has been labeled as an abstract class because of the absence of method definitions, i.e., abstract methods.
The instance diagram shows the object instances of the class calculateCost and its sub-classes: box, triangular and cylindrical. It shows the superclasses protected data members being accessed by the subclasses. The instance diagram depicts the flow of the object-oriented program and traces the entire execution path or process flow of the application. It shows the values and the calculations as it occurs in a real-time execution scenario.
The Use Case diagram illustrated the actors i.e., the Operator who initializes the stock of grade 1, grade 2, grade 3 of boards present in the company’s reserves for designing tubes and boxes. The processes of a customer logging in and making an order choice for a box or a tube, the grade, and the other additional specifications like reinforcible bottom, sealable top, color printing, etc.
The cost is calculated based on the grade of the material.
The additional costs of sealable tops, reinforcible bottoms, color printing are added to the total cost as percentages.
The main calculation is involved in the part where the surface area is calculated using the method calculateSurfaceArea.
It accepts the inputs for total units ordered (example n), the dimensions, and the type ( board grade) from the user.
For the Box it calculates the surface by employing the following mathematical calculation:
Surface area = n X length X height,
For the Triangular tube the following calculation is performed,
Surface area = n X {(0.5 X side1 X side2) + {squareroot {(side1)2 + (side2)2}* height},
+side1 X height + side2 X height.
For the cylindrical tube the surface area is calculated using the following mathematical formula:
Surface area = n X 3.14*radius2 + (2 X 3.14 X radius * height).
Here n is the number of ordered units or the quantity.
Height is the height of the triangular or cylindrical tube.
Side 1 and side 2 are the two sides of the triangle base tube.
Radius is the radius of the cylindrical tube.
Length, breadth, and height are the three sides of the box.
The total ordered surface areas of grade 1, grade 2, and grade 3 are compared with the initially entered quantity of board material by the order. Accordingly, the output is displayed and the message is shown whether the ordered quantity has exceeded the stock available.