Question: (JAVA) Create a class that encapsulates an Invoice that a hardware store might use to represent an invoice for an item sold at the store.
(JAVA)
Create a class that encapsulates an Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include three pieces of information as instance variables, a part number (type String), a quantity of the item purchased (type int), and a price per item (double). Your class should have a default constructor and an overloaded constructor each initializing the three instance variables. Provide accessors and mutators. In addition, provide a method that calculates and returns the invoice amount including an 8.6% sales tax, a toString() method that returns the state of the Invoice object, and an equals() method that compares two Invoice objects. Write a client test application that demonstrates class Invoices capabilities (e.g. test ALL methods of the Invoice class).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
