1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Artyom0805 [142]
2 years ago
10

Define a function in Scheme (or relation in Prolog) that checks whether a set of elements (represented as a list) is a subset of

another set (represented as a list).
Computers and Technology
1 answer:
mafiozo [28]2 years ago
4 0

Answer:

subset([],[]).

       subset([X|L],[X|S]) :-

           subset(L,S).

       subset(L, [_|S]) :-

           subset(L,S).

Success:

     subset([1,3], [1,2,3]).

     subset(X, [1,3,4]).        % error handling to compare sets in a given order

Fail:

     subset([2,1], [1,2,3]).   % compares in a different order from the first.

Explanation:

The function "Subset" in the source code above accepts two sets, then checks if the first set is a subset of the second. The code returns true if the condition is met.

You might be interested in
​ A wire service is also known as a ____.
charle [14.2K]
The answer is C press agency
4 0
3 years ago
Using this statement to answer the following question “FIFA World Cup 2010: (1+9) From Today!” (Ignore Quotation)
Yuliya22 [10]
Free space going around the town states
5 0
2 years ago
Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the t
arlik [135]

Answer:

import java.util.*;

public class Main

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

    System.out.print("Enter the first number: ");

    int n1 = input.nextInt();

    System.out.print("Enter the second number: ");

    int n2 = input.nextInt();

    System.out.print("Enter the third number: ");

    int n3 = input.nextInt();

 System.out.println("largest: " + LargestNumber(n1, n2, n3));

 System.out.println("smallest: " + SmallestNumber(n1, n2, n3));

}

public static int LargestNumber(int num1, int num2, int num3){

    int largestNum = 0;

    if(num1>=num2 && num1>=num3)

        largestNum = num1;

    else if(num2>=num1 && num2>=num3)

        largestNum = num2;

    else if(num3>=num1 && num3>=num2)

        largestNum = num3;

       

    return largestNum;

}

public static int SmallestNumber(int num1, int num2, int num3){

    int smallestNum = 0;

    if(num1<=num2 && num1<=num3)

        smallestNum = num1;

    else if(num2<=num1 && num2<=num3)

        smallestNum = num2;

    else if(num3<=num1 && num3<=num2)

        smallestNum = num3;

       

    return smallestNum;

}

}

Explanation:

Create function called LargestNumber that takes three parameters, num1, num2, num3. Find the largest number using if else structure among them and return it. For example, if num1 is both greater than or equal to num2 and num3, then it is the largest one.

Create function called SmallestNumber that takes three parameters, num1, num2, num3. Find the smallest number using if else structure among them and return it. For example, if num1 is both smaller than or equal to num2 and num3, then it is the smallest one.

Inside the main, ask the user for the inputs. Call the functions and print the largest and smallest.

8 0
3 years ago
Public class Bird
Anna007 [38]

Answer:

Answer below.

Explanation:

You are creating an object of bird "b" with a talon strength of 5 and a beak of 5.

public Hawk(int talon, int beak)

{

super(beak);

talonStrength = talon;

}

Please mark brainliest if this is the answer you were looking for

Please mark brainliest if this is the answer you were looking for

6 0
2 years ago
Select the correct answer from each drop-down menu.
evablogger [386]
Update and measure those are the only understand answers
6 0
3 years ago
Read 2 more answers
Other questions:
  • William has an internet connection that does not allow him to make calls when connected to the Internet. What internet service c
    8·2 answers
  • Saas provides services to an organization that requires the standard business process infrastructure such a CRM
    7·1 answer
  • What method of the Math object can be used to return the largest value from the values that are passed to it?
    14·1 answer
  • How does light move? Shift? Bounce between different objects?
    9·1 answer
  • A bastion host allows the firewall to connect to the internal network and the perimeter network.TrueFalse
    15·1 answer
  • A or an is a simple chip with two or more processor core
    5·1 answer
  • how do I delete my brainly account, my child signed up for it and nothing has been paid but I do not want the account to exist a
    7·2 answers
  • EMERGENCY- I am giving 55 points for this, please help. WITH working out
    7·1 answer
  • PLEASE HELP How have phones made us spoiled? How have phones made us unhappy?
    10·1 answer
  • What is the purpose of the GETPIVOTDATA function?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!