labs / tiddlers / content / labs / lab02 /
  1. Create a new Java class in your NetBeans project named InvoiceItem.

    Add the three fields from the class diagram to the class.

  2. Generate getters and setters for the fields using <

    Insert Code > Getter and Setter">>. Select all three fields and click <>. Note that the insert code feature is context sensitive --- you need to have the cursor inside the class, between the two curly brackets or you will not see the <> option.

  3. Add the getItemTotal method. It should multiply the salePrice with the quantityPurchased and return the result.

  4. If your code is looking a bit messy then format it using <