Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this project is to give students exposure to object-oriented design and programming using classes and polymorphism in an application that involves arrays

The purpose of this project is to give students exposure to object-oriented design and programming using classes and polymorphism in an application that involves arrays of objects and sorting arrays containing objects. You will write several classes for this lab exam. Please submit all classes coded along with the outputted report. Assignment: 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. 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 The program must only be tested using the file posted on Blackboard. You should not use another input text file. Record your planning time, coding time, testing time and bug fixing time. Include a comment with your name and this information at the top of the program. Sample Report Output: Note that lines have been omitted to show page headers. Your output does not have to match exactly, but all information should be properly labeled, report headers and column headers displayed. Office Supplies Inc. Customer Report Page 1 ======================= Customer ID Email Address Balance Tax Type Tax Amount ======== == ============= ====== ====== ========== Threads2 001 purchasing@threads2.com 29,000.00 tax liable 1,450.00 DAV2 002 purchasing@dav2.org 4,860.20 non-profit DAV3 003 purchasing@dav3.org 4,860.20 non-profit StopandShop3 004 purchasing@stopandshop2.com 8,100.00 tax liable 486.00 Office Supplies Inc. Customer Report Page 2 ======================= Customer ID Email Address Balance Tax Type Tax Amount ======== == ============= ====== ====== ========== Threads 349 purchasing@threads.com 29,000.00 tax liable 1,450.00 DAV 358 purchasing@dav.org 4,860.20 non-profit DAV2 359 purchasing@dav2.org 4,860.20 non-profit StopandShop 377 purchasing@stopandshop.com 8,100.00 tax liable 486.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

Briefly describe vegetative reproduction in plants.

Answered: 1 week ago

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago

Question

How do linear and nonlinear presentations differ? [LO-1]

Answered: 1 week ago