Specification

The Chinese invented cardboard in the 1600s and the English created the first commercial cardboard box in 1817.

FlexBox is a hypothetical company that makes an extensive range of boxes for packaging a wide range of goods. Due to the wide range of requirements of their customers, the variety of boxes they have to produce is very extensive.

The boxes are all rectangular and have the following characteristics:

  • They are all made of card;
  • The card has a specified grade;
  • The boxes may have no printing, or 1 or 2 colour printing;
  • Some boxes may have reinforced bottoms;
  • Some boxes may have reinforced corners;
  • All boxes may have sealable tops.

The types of boxes produced by the company are shown in Table 1.

Table 1. Types of cardboard boxes available. see image.

Table 2. Basic cost of 1 square metre of card. see image.

Table 3. Additional costs. see image.

There are some additional costs depending on whether the box has printing and whether there is any reinforcing. These are shown in Table 3 and the percentage increase is based on the basic cost.

When a customer asks FlexBox to quote a price for an order they specify the following:

  • The size of the box (width, length, and height);
  • The grade of card;
  • Whether they want any colour printing (no colour, or 1, or 2 colour printing);
  • Whether they want any bottom and/or corner reinforcement;
  • Whether the box has a sealable top;
  • The quantity of boxes.

From this information, the order system should determine if the type of box requested can be supplied by FlexBox; if it cannot, the system should display an appropriate message and reject the order. If the ordered box/boxes correspond to any of the types given in Table 1, and can be supplied by FlexBox, the cost of the order must be calculated and quoted.

Customers should not be asked for the type of the box they order, since this is only used within the company to calculate the cost: your application must determine the type of the ordered boxes (using Table 1).

If a customer is placing more than one order (say one order for 5 boxes (of type I) and another order of 10 boxes (of type II)), then he/she should receive a quote with the total cost of the orders.

Your task

(i)

Design and implement a Java application which will allow the customer to enter the details of his/her order and will calculate and display the cost of the order. Your system should verify that FlexBox can supply the type of box requested (the customer should not be asked to specify the box type).

The user-interface to your system should be a text-driven, console-based, menu interface there is no requirement for a graphical user interface.

The Java application must be written using Java 8 Standard Edition and should be structured as a NetBeans 8 project (i.e., exactly the same as the course environment). Regardless of your personal development platform, you must test your NetBeans application runs correctly in Microsoft Windows before submission (i.e., the Middlesex networked laboratory set-up).

Credit will be afforded for a good object-oriented design that uses abstraction, inheritance (and possibly polymorphism) with regard to a class hierarchy that describes the types of boxes that FlexBox sells. The work will be assessed according to good practise in class design, such as correct encapsulation and accessibility for class attributes and methods.

(ii)

Devise a suitable test plan and data, and use it to test the performance of your ordering system. Include a short report (MS Word maximum of two pages) describing your test strategy. This report should reside in the root folder of the NetBeans project.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.