Question: This program practices working with lambdas and streams. Provided Files: Java file Book.java contains a class for book data. Java file BookProject.java contains the starting
This program practices working with lambdas and streams.
Provided Files:
Java file Book.java contains a class for book data.
Java file BookProject.java contains the starting code with a book list constructed and methods filter
and process. You will need to write the bodies of these two methods; they are illustrated in the lectures.
Main Application:
Task : Ask the user for the category of book exDatabase and call filter method with
correct lambda to get list of books with this category
Display the count
If books, display headings and book title, format, and price in $
See sample output for correct display
Task : Ask the user for a price maximum of book ex and call filter method with
correct lambda to get back list of books with price maximum
Display the count
If books, display headings and book title, category, format, and price in $
See sample output for correct display
Task : Call process method with correct lambda convert book titles to upper case
Display the updated list with Book toString method
See sample output for correct display
Task : use streams to display only paperback titles, category, price sorted by title
Note: The Book class needs to implement Comparable to define natural ordering by title
See sample output for correct display
Task : Use streams to display book titles where title contains phrase entered by user
Display the count using the stream count method
If books, display headings and book title, category, format, and price in $
See sample output for correct display
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
