Question: CHANGES: Int getQuantity Double getTotalPrice String toString [total price] Write a Java class called InvoiceItem that represents an invoice with id, description, quantity, unitPrice. Your
Write a Java class called InvoiceItem that represents an invoice with id, description, quantity, unitPrice. Your InvoiceItem objects should have following methods: public void setFields(int newid, String newDesc, int newQty, double newUnitPrice) Sets the values for the fields in the InvoiceItem. public int getId() Returns the invoice's id public String getDescription Returns the invoice's description public String getQuantity Returns the invoice's quantity public int get TotalPrice() Returns the invoice's total price public String toString Returns a String representation of this invoice, such as "Invoice fid-7. dese - MyDesc, qty - 100, unit price - 58000.001" Write a client program called InvoceltemClient that creates objects of the Invoice class called inviti and invit2. Assign values to the fields of these objects. Print out these Invoice objects using System.out.println() method. W
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
