CSC 211

Spring, 2003

Assignment 5

Writing a class definition

Due: 11:59pm, Friday, May 16th

Purpose: This assignment asks you to write the definition of a class called InvoiceItem.

Write a class called InvoiceItem that represents an invoice item.  It should contain the following information: part number, part description, unit cost, quantity ordered, taxable item. 

Provide a constructor that takes as parameters each of the pieces of information needed to create an invoice item.  Provide one accessor method for each instance variable.   Provide a toString method (to be explained) that formats an invoice item's information as a String object. 

Write a program called InvoiceSingleItem that prompts the user for all of the information about an invoice item and then creates an invoice item object.  It then prints the invoice item and computes and prints the invoice gross amount as in the last assignment. 

What to submit: Through COL, submit a zip file containing both the InvoiceItem.java file and the InvoiceSingleItem.java file.