Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The class must include the following: Instance variables Constructors Accessors

ID: 3701688 • Letter: T

Question

The class must include the following: Instance variables Constructors Accessors and mutator methods Suitable toString () methods Assignment: Office Supplies Inc., an office supply store, services many customers. As customers orders ror 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 oWrite 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 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..

Explanation / Answer

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;
   }
  

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote