This is a short exercise in using the stream API. Suppose that the class Score is defined as class ScoreInfo { String firstName; String lastName; int score; ScoreInfo( String lName, String fName, int...


This is a short exercise in using the stream API. Suppose that the class Score is defined as class ScoreInfo {     String firstName;     String lastName;     int score;     ScoreInfo( String lName, String fName, int s ) {         firstName = fName;         lastName = lName;         score = s;     } } and that scoreData is an array of ScoreInfos containing information about the scores of students on a test. Use the stream API to do each of the following tasks: print the number of students (without using scoreData.length) print the average score for all of the students print the number of students who got an A (score greater than or equal to 90) use the collect() stream operation to create a List that contains the names of students whose score was less than 70; the names should be in the form first name followed by last name print the names from the List that was generated in the previous task print out the student's names and scores, ordered last name print out the student's names and scores, ordered by score You can put all of the code in main() routine and include ScoreInfo as a static nested class. Do not use any for loops or other control structures. Do everything using the stream API. For testing your code, you can use this array: private static ScoreInfo[] scoreData = new ScoreInfo[] {         new ScoreInfo("Smith","John",70),         new ScoreInfo("Doe","Mary",85),         new ScoreInfo("Page","Alice",82),         new ScoreInfo("Cooper","Jill",97),         new ScoreInfo("Flintstone","Fred",66),         new ScoreInfo("Rubble","Barney",80),         new ScoreInfo("Smith","Judy",48),         new ScoreInfo("Dean","James",90),         new ScoreInfo("Russ","Joe",55),         new ScoreInfo("Wolfe","Bill",73),         new ScoreInfo("Dart","Mary",54),         new ScoreInfo("Rogers","Chris",78),         new ScoreInfo("Toole","Pat",51),         new ScoreInfo("Khan","Omar",93),         new ScoreInfo("Smith","Ann",95) };

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here