Question: Overview You will implement a Java system that reads in an inventory file, prints the inventory to the console, and ships items. Business Rules There

Overview

You will implement a Java system that reads in an inventory file, prints the inventory to the console, and ships items.

Business Rules

There are two types of items tracked in the system: food items and household (durable) items.

Food Items: Food items are perishable, and a perishable item has a limited shelf life. The item must be removed from the shelf when it expires. The expiration date is simply

expiration date = date placed in inventory + shelf life in days

Household Items: Household items have unlimited shelf life, so they do not have an expiration date. They do have (sometimes substantial) weight. The shipping cost is $10.00 / pound. If the item is shipped on a weekend day, the shipping cost should be increased by $20.00.

Example: a 20 pound item shipped on Saturday would have a shipping cost of $220.00.

Program Design

Input

The program will take as input a file formatted as follows:

food,banana,5

food,bread,10

household,toaster,5

household,washer,200

The first element in a line is the type of item: food or household good. If the item is a food item, the second element is the name, the third is the shelf life in days. If the item is a household good, the second element is the name and the third is the shipping weight in pounds.

You will create an input file with the data above called "input.txt". When you load the file you should not use a full path.

Program Flow

The following pseudocode shows the required flow of the program.

Overview You will implement a Java system that reads in an inventory

Output

The output of the program for the input above would be

file, prints the inventory to the console, and ships items. Business Rules

NOTE: The remove from shelf dates are based on the date the program is run. They will not be the same as those shown above.

UML and Javadoc

The classes and interfaces have been specified for you, and are documented in the UML diagram below and in Javadoc. The Javadoc for the project is available in Blackboard as a zipped directory and on the web at http://162.243.207.40/.

There are two types of items tracked in the system: food items

Approach

Start by creating all the classes and interfaces and their methods and properties without worrying about what the methods do. When you have this code compiling, go back and implement the methods. For each class and method, read the relavent portion of the Javadoc and look at where it fits in the overall flow of the program (see the pseudocode).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!