Answer:
import java.util.Scanner;
public class num8 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter first number");
int X = in.nextInt();
System.out.println("Enter second number");
int Y = in.nextInt();
int Z;
if(X <= Y){
Z = 0;
}
else if(X >= Y){
Z = 1;
}
}
}
Explanation:
- The program is implemented in Java
- In order to set the values for X and Y, The Scanner class is used to receive and store the values in the variables (Although the questions says you should assume these values are set)
- The if conditional statement is used to assign values (either 0 or 1) to variable Z as required by the question.
Answer:
C
Explanation:
In simple words, data mining is defined as a process used to extract usable data from a larger set of any raw data. It implies analysing data patterns in large batches of data using one or more software.
The contains criteria filter requires the records displayed to have the specified text string anywhere. Thecontains operator is used to perform case-sensitive matching regardless of location in strings.
The begins with criteria filter on the other hand requires the records displayed to start with the specified text string
Addresses packets at the internet layer
Answer:
The output is "A"
Explanation:
public class Solution {
public static void main(String args[]) {
mystery(7);
}
public static void mystery(int a) { System.out.println("A"); }
public static void mystery(double a) { System.out.println("B"); }
public static void mystery(int a, double b) { System.out.println("C"); }
public static void mystery(double a, int b) { System.out.println("D"); }
}
In the code above; mystery is defined in four different ways called method overloading. Method overloading is when same method is defined with different parameters.
In the first case; mystery will be called if the argument is int.
In the second case; mystery will be called if the argument is double.
In the third case; mystery will be called if the arguments are int and double.
In the fourth case; mystery will be called if the arguments are double and int.
When mystery(7) is called; the mystery method requiring only int will be called and the output is "A".