Question: a class that represents an invoice, the class will have two instance variables: invoice amount and invoice number. Add appropriate setters and getters. a test

  1. a class that represents an invoice, the class will have two instance variables: invoice amount and invoice number. Add appropriate setters and getters.
  2. a test harness class that does the following:
    1. Instantiates 1000 invoice objects, the amount of each invoice should be a random number, and the invoice number should be a unique, sequential 5-digit number starting at 10000.
    2. Store each object in an appropriate single-dimensional array.
    3. Using a separate for loop, iterate the array and print the state of any invoice in which more than $500 is owing and the invoice number is even. (print a dashed line between each object print out, and use appropriate labels for each piece of information printed.)

Your output will look something like this:

Invoice amount: $560

Invoice #: 10004

------------------------------

Invoice amount: $568

Invoice #: 10014

------------------------------

Invoice amount: $860

Invoice #: 10044

------------------------------

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!