Answer:
Kasiski’s method for determining 't' works for Vigenère cipher as well. The only difference is therefore in the second stage of the attack. In the second stage, one needs to build a frequency table for each of the 't' keys, and carry out an attack like on the mono-alphabetic cipher. Given a long enough plaintext, this will work successfully.
Explanation:
Kasiski method is a method of attacking polyalphabetic substitution ciphers such as Vigenère cipher. It is also called Kasiski test or Kasiski examination.
The method involve finding the length of the keyword and then dividing the message into that many simple substitution cryptograms. Frequency analysis could then be used to solve the resulting simple substitution.
Answer:
1.trees_destroyed_per_hectare = 456/2.47
2. input(no_of_hectares)
3. no_of_trees_destroyed =no_of_hectares * trees_destroyed_per_hectare
4. print(no_of_trees_destroyed)
Explanation:
1.trees_destroyed_per_hectare = 456/2.47 //conversion of tress destroyed per acres to hectare
2. input(no_of_hectares) // get input from user in hectares that how many hectares are destroyed
3. no_of_trees_destroyed =no_of_hectares * trees_destroyed_per_hectare // total number of trees destroyed by fire on given day and given area
4. print(no_of_trees_destroyed)
Answer:
public class Calculator {
public double add(int a, int b){
return a+b;
}
public double substract(int a, int b){
return a-b;
}
public double multiply(int a, int b){
return a*b;
}
public double divide(int a, int b){
if(b>0){
return a/b;
}
else{
System.out.println("Cannot divide by zero");
}
return -1;
}
}
Explanation:
- Using Java Programming Language, the class Calculator is created. There are no fields (Instance variables) and no constructors since these are not required by the question.
- Four methods (functions) are created: add, substract, multiply and divide as specified in the question.
- Note the use of the if statement in the divide() to handle case of illegal division (by 0)
Answer:
Beginner
Explanation:
A program like this is ideal for a beginning exerciser due to the high number of repetitions and the sets are not much.
Cheers