Question
Write in java language ================== Office Supplies Inc., an office supply store, services many customers. As customers orders for office supplies are shipped, information is
Write in java language
==================
Office Supplies Inc., an office supply store, services many customers. As customers orders
for office supplies are shipped, information is entered into a file. Office Supplies bills their
customers once each month. At the end of each month, the Chief Executive Officer
requests a report of all customers sorted by their customer id (from lowest to highest). The
report includes their bill balance and tax liability.
Write a program to produce the outstanding balance report sorted by customer ID number
for each customer from the data in the text file.
You must use the text file provided for the
report in Canvas.
Below is a description of the information on the text file:
?
The first line on the file contains the number of customers on the file (numeric)
?
The fields below repeat for each customer:
o
Customer name (String)
o
Customer ID (numeric integer)
o
Bill balance (numeric)
o
EmailAddress (String)
o
Tax liability (numeric or String)
The customers served by the office supply store are of two types:
tax-exempt
or
non-tax-
exempt
. For a tax-exempt customer, the tax liability field on the file is the reason for the
tax exemptions: education, non-profit, government, other (String). For a non-tax exempt
customer, the tax liability field is the percent of tax that the customer will pay (numeric)
based on the state where the customers business resides.
Program requirements:
From the information provided, write a solution that includes the following:
?
A suitable inheritance hierarchy that represents the customers serviced by
the office supply company
.
It is up to you how to design the inheritance
hierarchy. I suggest a Customer class and appropriate subclasses.
.
?
For all classes include the following:
o
Instance variables
o
Constructors
o
Accessor and mutator methods
o
Suitable toString( ) methods
o
Any other appropriate methods
?
Write a class
LabExam
which utilizes the following:
o
An Array of Customer objects
o
A method that reads the input file provided and stores the objects in the array
of Customers.
o
A method that sorts the array of Customers in
ascending order
by the
customer ID. (you may use Arrays.sort(custList))
o
A method that formats and prints the output report. The report should include
the following requirements:
?
Report header at the start of each page showing the name of the
company, report and page number.
?
Report headers for each column of information.
?
One Customer per line.
?
At most 45 Customers per page.
?
All money amounts and percentages should be displayed with 2
decimal places and commas after each thousand.
o
A sample report is shown at the end of the assignment. The report produced
does not have to exactly match the sample output provided, but must contain
all required components listed above.
o
Any other helper methods used to meet the requirements of the assignment.
o
The main method will call all the other methods that will:
?
Read the text file and store the objects in the array
?
Sort the objects
?
Format and print the report
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started