Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Language. Not C++ or C# In cryptograms, each character is encoded into another. The frequency of letters in text has been studied for use

Java Language. Not C++ or C#
In cryptograms, each character is encoded into another. The frequency of letters in text has been studied for use in cryptanalysis, and frequency analysis in particular, dating back to the Iraqi mathematician Al-Kindi (c. 801-873 AD), who formally developed the method (the ciphers breakable by this technique go back at least to the Caesar cipher invented by Julius Caesar, so this method could have been explored in classical times). If the text is long enough, one can, as a strategy, use the frequency of occurrence of each character. The most frequently occurring character will likely be the code for an e, because e is the most frequently used letter of the English alphabet. Design a class Named CryptGram.java with the following requirements:
Data Members: a Letter(it is provided) array named orderedFrequency to store frequency of the 26 alphabetic letters. (Letter[] orderedFrequency;)
Methods:
public void createLetterFrequency(String text)
public int getFrequencyByChar(char letter)
public String encode(String textToBeEncoded)
public String decode(String textToBeDecoded)
The method: createLetterFrequency, create the letter frequency from the argument passed to this method, the letter frequency array MUST by sorted by frequency, for example, the first three Letter elements in the array may look like: d[2], r[5], a[6], which means d appears in the file twice, r five time, and a six times. If the frequencies are ties, then being ordered by alphabetic order. For instance, e[9] and c[9], c[9] should be placed before e[9].
The method: getFrequencyByChar, returns the number of times the char passed as argument appears in the file
The method: encode, encodes the String and returns encoded String. The text to be encoded is encrypted as follows: each character in the text will be encrypted to the character in the letter frequency array: orderedFrequency. For example, letter a or A will be encrypted to the letter of the first element in the orderedFrequency array. The letter z or Z will be encrypted to the letter of the last element in the orderedFrequency array.
The method: decode, reverse the encode process and decrypt the text (ignore cases)
To test your program, click on the CryptGramTester.class and Run JUnit button
Code Given (
import java.io.*;
public interface FrequencyEncrypt{
void createLetterFrequency(String str);
int getFrequencyByChar(char letter);
String encode(String textToBeEncoded);
String decode(String textToBeDecoded);
public final String TEXT="A Tool to Perform Item Analysis to Enhance the Teaching and Learning Experiences ADSTRACT: "+
"Assessment is one of the most essential educational tools. When properly developed and interpreted, assessments can help "+
"instructors better understand what their students are learning, identify specific areas which need clarification, and hence "+
"improve both teaching and learning experiences. Item analysis is a widely used tool to assess learning outcomes. It provides "+
"the means to gather evidence about students? knowledge on specific topics or knowledge areas. It can be used to identify students?"+
" strengths and weakness, monitor student learning and progress, and plan and conduct instruction. However, due to cumbersomeness of "+
"calculating relevant statistics, some best practices in item analysis are too infrequently used in actual practice. This paper describes "+
"an embedded item analysis tool that is integrated into the online programming assignment management and auto-grading system, and how it "+
"is used to assess students? learning outcomes and enhance teaching and learning experiences.";
}
)
image text in transcribed
inne javae public class letter implements comparable{ 2 private char letter; 3private int frequency 4 public Letter (char letter, int frequency) this.letter-letter; this.frequency-frequency: 9public int compareTo (Letter letter) ( 10 12 if (frequency letter. requency) return frequency-letter.frequency else return (nt) this.lecte:-nc)letcer.lettez ublio char geccha:0 xeturn letce:: publlo int geterequency 0etuun fzequencyi publ e void inozementFre quency D Erequebey- Omd arguments lis Package inne javae public class letter implements comparable{ 2 private char letter; 3private int frequency 4 public Letter (char letter, int frequency) this.letter-letter; this.frequency-frequency: 9public int compareTo (Letter letter) ( 10 12 if (frequency letter. requency) return frequency-letter.frequency else return (nt) this.lecte:-nc)letcer.lettez ublio char geccha:0 xeturn letce:: publlo int geterequency 0etuun fzequencyi publ e void inozementFre quency D Erequebey- Omd arguments lis Package

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions

Question

3. Develop a case study.

Answered: 1 week ago