Answered step by step
Verified Expert Solution
Question
1 Approved Answer
solve this task part 1 and part 2 TASK 2: Analyse the following Java code in Figure 1 and 2. Rewrite the given program code
solve this task part 1 and part 2
TASK 2: Analyse the following Java code in Figure 1 and 2. Rewrite the given program code using logie programming paradigm, Prolog. Your solution should include recursive concept and demonstrate the query sample. Part 1 import java.util. import java.util.strem.Collectors public class Fitter public static Listen apply Lister ist, Double target return ist strand rapoolel Number:doublevate falteri ele -> elen > target boxed .collect Collectors.tocollection ArrayLists the > public static void maintString) argsl { Integer tus new Integeri (1,2,3,4,5,6,7,8,9): Doublell munnen Double 11 2.1.3.2.4.3.5.,6.5.7.0.0.7) System.out.printint Filter.solyt Arrays.aslistinus). 5.01 3 Figure 1. Filter the numeric elements based on target value Part 2 irport java.util. import java.util.strea.. public class Dene public static void main(Stringi) args) { String ist ): StreaStringll> strear = Arrays.streamlist); System.out.printla stran .Fatalar - Arrays.strear > collecti Collectors.tocollection Linkedist:new >> Figure 2: Joining the elements from the array objects as a collection of objects Marks Allocation: Criteris Marks Part I: 10 mark - Base rule. recursive rule, list head tul), input anument is marks -Query and output sample Part 21 10 marks Base rule, recursive rale, lise head tail), appropriate condition marks -Query and purple Total20 marks DELIVERABLES A report comprising of the following elements: 1. Introduction Solution for Task 1 and 2 Source code Screenshot of the running program TASK 2: Analyse the following Java code in Figure 1 and 2. Rewrite the given program code using logie programming paradigm, Prolog. Your solution should include recursive concept and demonstrate the query sample. Part 1 import java.util. import java.util.strem.Collectors public class Fitter public static Listen apply Lister ist, Double target return ist strand rapoolel Number:doublevate falteri ele -> elen > target boxed .collect Collectors.tocollection ArrayLists the > public static void maintString) argsl { Integer tus new Integeri (1,2,3,4,5,6,7,8,9): Doublell munnen Double 11 2.1.3.2.4.3.5.,6.5.7.0.0.7) System.out.printint Filter.solyt Arrays.aslistinus). 5.01 3 Figure 1. Filter the numeric elements based on target value Part 2 irport java.util. import java.util.strea.. public class Dene public static void main(Stringi) args) { String ist ): StreaStringll> strear = Arrays.streamlist); System.out.printla stran .Fatalar - Arrays.strear > collecti Collectors.tocollection Linkedist:new >> Figure 2: Joining the elements from the array objects as a collection of objects Marks Allocation: Criteris Marks Part I: 10 mark - Base rule. recursive rule, list head tul), input anument is marks -Query and output sample Part 21 10 marks Base rule, recursive rale, lise head tail), appropriate condition marks -Query and purple Total20 marks DELIVERABLES A report comprising of the following elements: 1. Introduction Solution for Task 1 and 2 Source code Screenshot of the running program Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started