Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions