Question: Use the class, Invoice, provided to create an array of Invoice objects in a test class named Program 4 , also provided. Class Invoice includes

Use the class, Invoice, provided to create an array of Invoice objects in a test class
named Program4, also provided. Class Invoice includes four private instance
variables; partNumber (type String), partDescription (type String), quantity of the item
being purchased (type int), and pricePerItem (type double).
Write a class named ProcessInvoices that use Lambdas and Streams to perform the
following queries on the array of Invoice objects and display the results:
a. Sort the Invoice objects by partDescription, then display the results.
b. Sort the Invoice objects by pricePerItem, then display the results.
c. Map each Invoice to its partDescription and quantity, sort the results by quantity,
then display the results.
d. Map each Invoice to its partDescription and the value of the Invoice (i.e., quantity
* pricePerItem). Order the results by Invoice value.
e. Modify Part (d) to select the Invoice values in the range $200.00 to $500.00.
f. Find any one Invoice in which the partDescription contains the word Saw.
See the test class Program4 in the Program4-Template.java file for more details. Do
not modify the main method of this class. You will not receive credit for this
program, if you do.
All classes in this program must be public, non-static, and not nested in other
classes.
No input, processing or output should happen in the main method. All work
should be delegated to other non-static methods and handle all exceptions where
necessary.
Format all monetary values to two decimal places with a floating dollar sign ($). See the
sample output for more details

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!