1

Write in java language ================== Office Supplies Inc., an office supply store, services many customers. As...

Question

Write in java language ================== Office Supplies Inc., an office supply store, services many customers. As...

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 customer’s 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

Answers

As per your requirement the below one is solution please follow it step by step

Customer.java

package myPackage;

public class Customer {
private String custName;
private int custID;
private double balance;
private String email;
public String getCustName() {
   return custName;
}
public void setCustName(String custName) {
   this.custName = custName;
}
public int getCustID() {
   return custID;
}
public void setCustID(int custID) {
   this.custID = custID;
}
public double getBalance() {
   return balance;
}
public Customer(String custName, int custID, double balance, String email) {
  
   this.custName = custName;
   this.custID = custID;
   this.balance = balance;
   this.email = email;
}
@Override
public String toString() {
   return "customer name:" + custName + ", customer ID:" + custID + ", balance:" + balance + ", email:" + email;
}
public void setBalance(double balance) {
   this.balance = balance;
}
public String getEmail() {
   return email;
}
public void setEmail(String email) {
   this.email = email;
}

}


ExemptCustomer.java

package myPackage;

public class ExemptCustomer extends Customer {

   private String liability;

   public ExemptCustomer(String custName, int custID, double balance, String email, String liability) {
       super(custName, custID, balance, email);
       this.liability = liability;
   }

   @Override
   public String toString() {
       return super.toString()+" liability:" + liability + "]";
   }

   public String getLiability() {
       return liability;
   }

   public void setLiability(String liability) {
       this.liability = liability;
   }
  
}


NonExemptCustomer.java

package myPackage;

public class NonExemptCustomer extends Customer {
   private double liability;

   public NonExemptCustomer(String custName, int custID, double balance, String email, double liability) {
       super(custName, custID, balance, email);
       this.liability = liability;
   }

   @Override
   public String toString() {
       return super.toString()+"liability:" + liability ;
   }

   public double getLiability() {
       return liability;
   }

   public void setLiability(double liability) {
       this.liability = liability;
   }
  

}


Similar Solved Questions

1 answers
A two-dimensional closed basin is 30 m long and the depth varies linearly from 2 m...
A two-dimensional closed basin is 30 m long and the depth varies linearly from 2 m at one end to zero at the other end. Calculate the fundamental period of oscillation for this basin. (Note: do not simply use the average depth of the basin to solve this problem.) -Basic coastal Engineering, Chapter ...
1 answers
Tax Prep 1 (Tax course 101 Final) Back . < $250 000 d. None of these...
Tax Prep 1 (Tax course 101 Final) Back . < $250 000 d. None of these Marks 1 John is a single taxpayer His taxable income on Form 1040, line 10 is $21,810 John will use which method to figure the tax on his taxable income Choose one answer a Tax table Tax rate schedule Percentage od Tax calculati...
1 answers
Variable and Absorption Costing Chandler Company sells its product for $104 per unit. Variable manufacturing costs...
Variable and Absorption Costing Chandler Company sells its product for $104 per unit. Variable manufacturing costs per unit are 545, and fixed manufacturing costs at the normal operating level of 12,000 units are $240,000. Variable selling expenses are $15 per unit sold. Fixed administrative expense...
1 answers
Question 14 2pc A generator coil is rotated through 15 revolutions in 280 ms. calculate the...
Question 14 2pc A generator coil is rotated through 15 revolutions in 280 ms. calculate the maximum em that is generated if the coil is circular with a 12 cm diameter has a turns, and is in a uniform 1.85 T magnetic field. 2300 V 9000 V 3607 7207 NO 1400V Question 13 2 pts Calculate the magnetic fie...
1 answers
Predict the product(s) for each reaction sequence below. a m PhP cuncunu ondoreng CH3CH2CH2CH2Li CH,OCH,CHz ether
Predict the product(s) for each reaction sequence below. a m PhP cuncunu ondoreng CH3CH2CH2CH2Li CH,OCH,CHz ether...
1 answers
Problem 10-29 (Algorithmic) (LO. 3, 4) Alicia sold her personal residence to Rick on June 30...
Problem 10-29 (Algorithmic) (LO. 3, 4) Alicia sold her personal residence to Rick on June 30 for $185,000. Before the sale, Alicia paid the real estate tax of $2,775 for the calendar year. For income tax purposes, the deduction is apportioned as follows: $555 to Alicia and $2,220 to Rick. What is Ri...
1 answers
Chapter 27, Problem 011 In the figure circuit section AB absorbs energy at a rate of...
Chapter 27, Problem 011 In the figure circuit section AB absorbs energy at a rate of 71 W when current i = 1.4 A through it is in the indicated direction. Resistance R = 2.0 92. (a) What is the potential difference between A and B? Emf device X lacks internal resistance. (b) What is its emf? w (a) N...
1 answers
Book: An Introduction to Community & Public Health Question: Do people have a right to choose...
Book: An Introduction to Community & Public Health Question: Do people have a right to choose whatever lifestyle they want -no matter how unhealthy? Discuss your opinion about individual responsibility for good health?...
1 answers
How do you find #dy/dx# given #x=2y^5+y^3+4#?
How do you find #dy/dx# given #x=2y^5+y^3+4#?...
1 answers
Question: How can I solve it in "Java program"?, i need test code also. Define Pi...
Question: How can I solve it in "Java program"?, i need test code also. Define Pi to be a parking lane i in a parking lot and carj to be the jth car; where the number of lanes in a parking lot is 4 and there are 7 cars to park. 1<= i<=4, and Cj: 1<=j<=7. Assume that all lanes ar...
1 answers
Help with java . For this project, you will design and implement a program that analyzes...
Help with java . For this project, you will design and implement a program that analyzes baby name popularities in data provided by the Social Security Administration. Every 10 years, the data gives the 1,000 most popular boy and girl names for kids born in the United States. The data can be boiled ...
1 answers
In terms of interest rate hedging, a liability sensitive bank means that the bank... In terms of interest rate hedging, a liability sensitive bank means that the bank has more interest sensitive d...
in terms of interest rate hedging, a liability sensitive bank means that the bank... In terms of interest rate hedging, a liability sensitive bank means that the bank has more interest sensitive deposits (and perhaps other liabilities) than rate sensitive assets in the particular planning period....
1 answers
Please show all work. Must be completed using financial formulas, NO EXCEL. a. Calculate the NPV, IRR, MIRR, and traditional payback period for each project, assuming a required rate of return of 8%....
Please show all work. Must be completed using financial formulas, NO EXCEL. a. Calculate the NPV, IRR, MIRR, and traditional payback period for each project, assuming a required rate of return of 8%. b. If the projects are independent, which project(s) should be selected? If they are mutually exclu...
1 answers
*Write a paper on how to identify alcohol abuse in adolescent.
*Write a paper on how to identify alcohol abuse in adolescent....
1 answers
3. Many chemotherapy drugs used to treat cancer work by modifying the mitotic spindle. Given the...
3. Many chemotherapy drugs used to treat cancer work by modifying the mitotic spindle. Given the short description of the two drugs here, describe how these drugs are effective in stopping cancer cells and where in the cell cycle they are effective. Paclitaxel works by interfering with normal microt...
1 answers
14. What is company's margin of safety in units for projected Year 16? 15. What is...
14. What is company's margin of safety in units for projected Year 16? 15. What is the company's margin of safety as a percentage for projected Year 16? not for the projected Year 16 relative to Year 15 and 16. Is the margin of safety as a percentage improving or by how much? Eoxtrot Manufac...

-- 0.050099--