JAVA ECLIPSE Code from scratch. Submission is the usual: zip of completed project, plus screen shot(s) of test run(s)
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →HW11-1: Lambda Review Problem(s) Student instances include a name and String “major” field (e.g., “CS”) . The Dean of CSM at Rowan would like to add a special designator called numericIndicator of type int. class Student has an accessor and a setter method setNumericIndicator(int n). This is an exercise to self-test to see if you can do OOPDAlevel work to define a class and use concepts relating mainly to lambda expressions. Deliverable: Attach zip of a completed Eclipse project to test all this, plus a Word document with screen shots of testing and comments. The Dean has expressly asked that the value be generated mathematically, as a sum of two integers, to be handled as a Lambda Expression. Students will be assigned the sum of two numbers, such as two and three, which is computed as: answer = 2 + 3; 1. Write a Lambda expression using a standard functional interface called calcIndicator that will take two numbers and add them to return a sum. 2. Given a single Student object called student1, show how this method would be used to update the instance with a new value. 3. If we have an ArrayList of called studentList, can you write code to unconditionally change the indicator value of every instance in the collection using the lambda handling described above, in a pipeline?? [When I tested this, I took the liberty of generating random values 0 to 9 for each argument. Major codes were also generated randomly] • Use some form of a stream operation to do this • Write a Predicate cs to determine if the student has a major of “CS” • Use a stream and apply the lambda to CS students only, using your predicate in the stream, so only CS students will have a non-zero indicator. My sample output: OOPDA HW11A-1 Lambda Review revSP22 Setting Random values with CS filter Updated values: -Mike, major: CS = 7 -Sarah, major: CS = 9 -Jennifer, major: Math = 0 -Sam, major: Math = 0 -Tom, major: Engr = 0 -Eli, major: AstroPhysics = 0 p. 1 3/26/2022 10:55 AM
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds