Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

This assignment models a simplified delivery company. It is composed of the following departments:  receiving which contains a list of packages to be delivered, shipping which ships the packages accounting which monitors the packages delivered, packages shipped, how they are shipped, where they are delivered to and revenues.

The project simulates the processing of a given set of packages. The packages consist of either standard delivery packages or overnight packages. The vehicles consist of planes and trucks. The accounting department records the revenues and shipments.

Class Design

The application must include the classes in the class diagram below. All data members must be private.

Note: This class diagram does not include all of the methods and data members required to implement this design.

Class Descriptions

DeliveryCompany

The delivery facility consists of Receiving, Accounting and Shipping Departments. It has a function, processPackages(), which processes the packages from Receiving to Shipping and conveys information to accounting.

Receiving

The Receiving Department consists of a list of packages to be delivered. It makes available the information on each package. The transport mode, truck or plane, is determined using a lookup table based on the zone the package is to be delivered to.

Shipping

The Shipping Department ships the packages by creating a shipment object for each package. It assigns a shipping ID to each package.

Accounting

The Accounting Department tabulates the number of packages shipped by zone and mode of transport and the total revenue.  

Package Class Hierarchy

The package class hierarchy consists of the base class Package and two derived classes: StandardPackage and OvernightPackage. The base class contains an ID, addressee name, zone to be mailed to, weight, and a cost parameter. The derived classes calculate costs based on the cost parameter stored in the base class. The overnight package rate is a flat fee as a function of the zone and the standard package rate is a function of the weight and the zone i.e. the rate per pound will depend on the zone the package is being sent to.

Assignment Requirements

Implement the delivery company using the classes specified in the class diagram above.

Construct a cpp file named DeliveryRun.cpp with main() in it. That main will have two statements: one will instantiate a DeliveryCompany object and the other will call the method processPackages() using that object.

The packages to be delivered are contained in ShippingCompanyInput.txt. Each line in the file represents a package and contains the following information:

1.       Priority (O = overnight and S = standard)

2.       Name of customer (no spaces in the customer name)

3.       Zone to be delivered to (1, 2, or 3)

4.       Weight of the package (in pounds)

The charges for each type of package to each zone are included in the Util.h file. The overnight rate is a function of the three delivery zones (OVERNIGHT_RATE). The standard rates are given per pound for each of the delivery zones (STANDARD_RATE_PER_POUND).

The transport mode for each package is a function of the type of package (overnight or standard) and the delivery zone (1, 2, or 3). These are given in OVERNIGHT_MODE and STANDARD_MODE in util.h.

The output must consist of:

1.       A detailed listing of each package

2.       A detailed listing of each shipment

3.       A summary of the shipments

o Number of packages

  1. By transport mode (plane or truck)
  2. By zone (1, 2, or 3)
  3. Total

o Total revenue

Each class with data to be printed out should include its own toString() function. The output can then be generated from the  DeliveryCompany class.

Java, Programming

  • Category:- Java
  • Reference No.:- M9525980

Have any Question?


Related Questions in Java

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As