Lab 6 Programming Algorithms and Patterns
Lab 6 Programming Algorithms and Patterns
Complete all these following programs as explained during classes. All missing coding
statements were provided there with explanation. Create and Submit a Word file
Lab6ProgramminAlgorithmsandPatternsYourName.docx which includes output screenshots
for every Java Project. Submit Java projects too.
1. Stream Processing
Create StreamProcessingProject as done during class to demonstrate the use of stream
processing methods as shown hereafter in Figure.
• Complete LambdaTripProject (from Lab 5) as shown in Figure, to store the records of the
file Trip.in (use delimiter \t to read Trip.in) onto an HashSet.
• Use created Java class Trip.
• Add every record stored as an object into HashSet.
• Print then all elements of faculty HashMap applying Lambda expression invoking
toString( ) method as shown hereafter.
• Print all elements of the HashMap sorted with respect to key f_Id as shown hereafter.
• Print all elements of the HashMap sorted with respect to value of faculty bonus invoking
doCalc_Bonus() as shown hereafter.
• Print all elements of the HashMap sorted with respect to value of faculty tax bonus
invoking doBonus_tax().
• Print all elements of the HashMap sorted with respect to value of faculty salary.
420-930-VA Prog. Algorithms 3/4 CEGEP VANIER COLLEGE 2024
• Print all elements of the HashMap sorted with respect to value of faculty f_Lname as
shown hereafter.
• Print all elements of the HashMap sorted with respect to value of faculty f_Lname in
reverse order as shown hereafter.
• Search for any matching key of Faculty last name "Smith" in HashMap using filter( ) as
shown hereafter.
• Search for any matching of Faculty bonus rate of "1.5" in HashMap using filter( ) as
shown hereafter.