Posts

Showing posts with the label encryption program in java

Encryption Program ISC Computer Science 2011 Practical

Encryption is a technique of coding messages to maintain their secrecy. A string array of size 'n' where 'n' is greater than 1 and less than 10, stores single sentences (each sentence ends with a full stop) in each row of the array. Write a program to accept the size of the array. Display an appropriate message if the size is not satisfying the given condition. Define a string array of the inputted size and fill it with sentences row-wise. Change the sentence of the odd rows with an encryption of two characters ahead of the original character. Also change the sentence of the even rows by storing the sentence in reverse order. Display the encrypted sentences as per the sample data given below: Test your program on the sample data and some random data. Example 1 : INPUT: n = 4 IT IS CLOUDY. IT MAY RAIN. THE WEATHER IS FINE. IT IS COOL. OUTPUT: KV KU ENQWFA. RAIN MAY IT. VJG TGCVJGT KU HKPG. COOL IS IT. Example 2 : INPUT: n = 13 OUTPUT: INVALID ENTRY import java.util.Scan...

Encrypt Program ISC Specimen 2023 Theory

A class Encrypt has been defined to replace only the vowels in a word by the next corresponding vowel and forms a new word, i.e. A → E, E  → I, I  → O, O  → U and U  → A. Example : Input: COMPUTER Output: CUMPATIR Some of the members of the class are given below: Class name : Encrypt Data members/instance variables : wrd: to store a word len: integer to store the length of the word newWrd: to store the encrypted word Methods/Member functions : Encrypt(): default constructor to initialize data members with legal initial values void acceptWord(): to accept a word in uppercase void freqVowCon(): finds the frequency of the vowels void nextVowel(): replaces only the vowels from the word stored in 'wrd' by the next corresponding vowel and assigns it to 'newWrd', with the remaining alphabets unchanged void disp(): displays the original word along with the encrypted word Specify the class Encrypt giving details of the constructor, void acceptWord(), void freqVowCon(), void ...