Design a class named cryptgram java with given requirements

Assignment Help JAVA Programming
Reference no: EM131541189

Assignment

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.

Methods:

createLetterFrequencyFromFile(File file) getFrequencyByChar(char letter)
encode(String textToBeEncoded)
decode(String textToBeDecoded)

The method: createLetterFrequencyFromFile, reads a file and creates the letter frequency, 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)

A demo program is provided for testing. To run the demo, click on the FrequencyEncryptDriver.class, provide file name and text to be encrypted in the argument list. For example *cryptgram.txt java Note: class name, variable name, and method names MUST be the same as specified.

Attachment:- Attachments.rar

Reference no: EM131541189

Questions Cloud

Suppose you are the newly-elected president trump : Suppose you are the newly-elected President Trump. During your campaign, you promised voters that you would do everything in your power to get investment.
Describe how would you test this hypothesis : Describe how would you test this hypothesis?
Analyze branding and packaging : Choose a brand that you feel loyal to and describe the product and its branding and packaging strategies. In assignment, you will analyze branding and packaging
Forgone bicycles in western leisureland : What it is the opportunity cost of producing an additional bowling ball measured in terms of forgone bicycles in western Leisureland?
Design a class named cryptgram java with given requirements : Design a class Named CryptGram.java with given requirements: Data Members: a Letter array named orderedFrequency to store frequency of 26 alphabetic letters.
What will you do to reduce bob resistance : You work for a large corporate business. One of the managers at the company receives an anonymous e-mail message claiming that a certain employee.
Discuss how the requirement of daycare : Discuss how the requirement of daycare can influence Hermione's decision.
Discus the use of critical thinking skills in analyzing : For this assignment you will submit a 15 page paper, not including the title and reference pages, on the Mental Health of Inmates.
Explain each of the threat or vulnerability pairs : Analyze and explain each of the threat/vulnerability pairs and their likelihood of occurrence. Justify your reasoning for each chosen management technique.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd