Answer:
import java.util.*;
public class MyClass {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
System.out.print("Input a word: ");
String userinput = input.nextLine();
for(int i =0;i<userinput.length();i+=2) {
System.out.print(userinput.charAt(i));
}
}
}
Explanation:
This line prompts user for input
System.out.print("Input a word: ");
This declares a string variable named userinput and also gets input from the user
String userinput = input.nextLine();
The following iterates through every other character of userinput from the first using iteration variable i and i is incremented by 2
for(int i =0;i<userinput.length();i+=2) {
This prints characters at i-th position
System.out.print(userinput.charAt(i));
Answer:d) Mono-alphabetic substitution rules
Explanation: Poly-alphabetic cipher is the cryptography that is done by using the many alphabets in substitutional way. They are supposed to have a good security because they use cipher text alphabets for the encryption and then decrypts it.
Substitution of the alphabets is done by the rule of the mono-alphabetic substitution rules.Other given options are incorrect because they are not used in the cryptography of the alphabetic cipher. Thus option (d) is the correct answer.
Answer:
b) Plus sign
Explanation:
The plus sign or addition operator (+) accomplishes concatenation. This is a greatly used in the Java's output Statement to combine values coming from different data types into a formatted output
consider the code snippet below which uses concatenation to output information about an individual
public class Name {
public static void main(String[] args) {
int age =18;
String name = "John";
System.out.println("His name is "+name +" and his age is "+age);
}
}
The + operator has been used to concatenate the int value age and the String value stored in name to the output
Explanation:
As the qn was copy pasted from another document...the qn seems incorrect... and incomplete..
pls see to it and attach the correct qn...
sorry