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: $; ePads: $; and eWatches are $ In addition,
DeltaComputing sells a highend computer an ePC selling for $ but ePC units are only available
to businessgovernment 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 'whitespace tokenized" in the follow format:
Sample data could be:
TimKling Personal order for one ePhone and one eWatch
DeltaCollege Nonprofit order for ePads
PioneerElectronics Business order for ePhones, ePads,
eWatches, and ePCs
The customer type codes are: General general or individual customer
Business or government customer
Nonprofit customer taxexempt
Your program should read sales data linebyline 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 endoffile 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 linebyline processing to keep the data synchronized with the processing loop.
Michigan sales tax is charged for all personal and business orders but not nonprofit orders. Tax will
be charged on the cost of the order ie be sure to calculate tax on the base charge ie 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 product items and costs $ to ship
a small box holds product items and costs $ 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 bags will be shipped in six boxes: two large, and four small with one small box not completely
full
For highvolume customers, these shipping costs are reduced by if the total number of product items is
over All nonprofit 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
discount off of the product total before shipping
Any businessgovernment order that totals over $ receive 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 $xxxxxxx $xxxxx $xxxxx $xxxxx $xxxxxxx xx xx
xxxxxxxxx $xxxxxxx $xxxxx $xxxxx $xxxxx $xxxxxxx xx xx
and so on
TOTALS $xxxxxx $xxxxxx $xxxxxxx 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
