Question: Objective To build a complete working Java program that applies control structures and file processing. Overview & Instructions Write program that builds a summary of

Objective
To build a complete working Java program that applies control structures and file processing.
Overview & Instructions
Write program that builds a summary of electronic sales. DeltaComputing is a manufacturer of popular
ePhone, ePads, and eWatches. The company also sells their products to wholesale customer.
Primary product costs are: ePhones: $499.99; ePads: $399.99; and eWatches are $299.99. In addition,
DeltaComputing sells a high-end computer (an ePC selling for $2999.99), but ePC units are only available
to business/government customers.
Sales requests are "batched" daily within an input file for processing. The file for today can be found at the
provided link: eOrders.txt. The file is 'white-space tokenized" in the follow format:
Sample data could be:
TimKling 0101 Personal order for one ePhone and one eWatch
DeltaCollege 20300 Non-profit order for 30 ePads
PioneerElectronics 114398223 Business order for 143 ePhones, 98 ePads, 22
eWatches, and 3 ePCs
The customer type codes are: 0- General general or individual customer
1- Business or government customer
2- Non-profit customer (tax-exempt)
Your program should read sales data line-by-line and generate a sales cost summary for each line. Assume
the input file is consistently tokenized allowing general input strategies available with the Scanner class.
Further assume an unknown number of orders in the file. Allow the end-of-file indicator to terminate the
program.
Important: Note that the number of data tokens is not the same for all customer types. If a customer is a
business, there are four additional data tokens. Otherwise, there are three. This must be accommodated
within the line-by-line processing to keep the data synchronized with the processing loop.
Michigan sales tax (6%) is charged for all personal and business orders but not non-profit orders. Tax will
be charged on the cost of the order (i.e. be sure to calculate tax on the base charge - i.e. before discounts
and before shipping).
Shipping involves distribution of the electronic devices into boxes. To make shipping a bit easier, assume
(unrealistically) that all three product item have the same size of packaging. Shipping can then be
determined by the total number of items in an order and the number of and type of boxes needed to ship.
The boxes come in two sizes:
a large box holds 20 product items and costs $19.99 to ship
a small box holds 4 product items and costs $5.99 to ship
The order is shipped in the least expensive manner. The rule for packing is to fill the large boxes
completely; that is, the box is fully packed. Only the small boxes can have empty spaces. For example, the
order of 54 bags will be shipped in six boxes: two large, and four small (with one small box not completely
full).
For high-volume customers, these shipping costs are reduced by 30% if the total number of product items is
over 100. All non-profit orders receive free shipping.
Discounts are offered for the following circumstances:
Any personal order that includes at least one ePhone, one ePad, and one eWatch receive a 5%
discount off of the product total (before shipping)
Any business/government order that totals over $50,000 receive 10% discount on the product total
Your output should appear as an organized, formal financial report summarizing each order in detail. Write
your entire output report to either the console or an external file. This will preserve formatting and
alignment of the report. An example format could be:
Boxes
Customer Base Cost Discount Tax Shipping Total Sm Lg
xxxxxxxxx $xxxxx.xx $xxx.xx $xxx.xx $xxx.xx $xxxxx.xx xx xx
xxxxxxxxx $xxxxx.xx $xxx.xx $xxx.xx $xxx.xx $xxxxx.xx xx xx
... and so on ...
TOTALS $xxxx.xx $xxxx.xx $xxxxx.xx xxx xxx
Be sure all dollar amounts are formatted to two decimal places. After completing all output lines for each of
the orders in the input file, write totals at the bottom of your report for the tax, shipping, total, and box
columns. This implies accumulating the totals as you process them within the file loop and then writing
them after the loop completes.

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 Programming Questions!