Set up a class named mycipher

Assignment Help Computer Engineering
Reference no: EM133550370

Question: Set up a class named MyCipher. The class will have private int data member named key. It also has the following methods:

• a constructor initializing key with 0

• a method named setKey(int k) that takes a positive integer and puts it into key

• a get method for key

• a method named encode(String s) that takes a text file and encodes it to a new cipher text file by adding the key value to each alphabet character in the plain text file For example, if the first line of plain text is "attack at dawn" and key is 5, it should be encoded as "fyyfhpefyeifas" because 'a' 5 = 'f', 't' 5 = 'y', 'c' 5 = 'h', 'k' 5 = 'p', ' ' 5 = 'e', 'd' 5 = 'i', 'w' 5 = 'a', and 'n' 5 = 's'. The String s accepted as a parameter for the encode method should be the path and filename of the .txt file you are wanting to encode. For example, to encode the file I gave you to test with, your argument passed to encode() might contain "c:\\java\\attack.txt"

Reference no: EM133550370

Questions Cloud

Has a section to accommodate pro privileges : Has a section to accommodate pro privileges from the other delivery apps, e.g., Uber One subscription; Ability to visualize orders from different delivery apps
Relationship between cellular respiration and photosynthesis : Explain the relationship between cellular respiration and photosynthesis. How is this related to plants? (Hint: Do plants go through cellular respiration?)
Draw the recursive process of mergesort : Draw the recursive process of Mergesort and Quicksort for sorting the sequence {5, 1, 2, 9. 7}. You will get a recursion tree for Mergesort and Quicksort
What proportion of their offspring will have intermediate : Gene B shows an incomplete dominance pattern. If we cross two heterozygotes (Bb x Bb), what proportion of their offspring will have the intermediate phenotype?
Set up a class named mycipher : Set up a class named MyCipher. The class will have private int data member named key. It also has the methods
How does maccormick justify his selection : How does MacCormick justify his selection of the nine algorithms that he chose as exemplars of having changed the future? influenced the development of systems
Find the eigendecomposition : Find the eigendecomposition of X, we will need to find the eigendecomposition of an m × m matrix. Since m is much larger than d, this is slow.
What best describes astrobiology : What best describes astrobiology? Study of the origin, evolution, distribution, and fate of life in the universe Search for extraterrestrial
How do the chemical properties of these molecules relate : How do the chemical properties of these molecules relate to their physical properties and ultimately their respective functions in cell membranes and cell walls

Reviews

Write a Review

Computer Engineering Questions & Answers

  Define primary way in society use psychological theories

discuss the primary way in which society or an individual could use the psychological theories

  Write java program that can serve as simple calculator

Write down a Java program that can serve as a simple calculator. This calculator keeps track of a single number (of type double) that is called result and that starts out as 0.0.

  Relationships between web analytics and text mining

Based on what you learn from the vignette, what do you think are the relationships between Web analytics, text mining, and sentiment analysis?

  What are some things the designers had to take

What are some things the designers had to take into consideration when designing for the mobile application? What improvements would you recommend

  Print the characters from the first integer to the second

Write a function called printCharacters() that accepts a string and two integers. The function should simply print the characters from the first integer.

  Implement a solution of prims algorithm

Write a program to create using a priority queue to implement a solution of Prim's algorithm. Input data describing the graph will be arranged as a list of edge

  Explain what is meant by angle tolerance in triangulation

Explain and sketch what is meant by angle tolerance in triangulation. How does it affect the triangulation accuracy?

  Discuss medical device software development plays a key role

Discuss Medical device software development plays a key role in improving the quality and efficiency of healthcare.

  Evaluate the features and architecture of different games

K/615/1671-Games Engine & Scripting-Pearson BTEC Levels 4 and 5 Higher Nationals in Computing Specification.Evaluate the features and architecture.

  What is good and bad about each one

Research 3 online tools/services on the internet....tell me what they offer, what is good and bad about each one, and what would you recommend?

  Describe the standing operating procedures

Playbooks, sometimes known as Standing Operating Procedures (SOP) or runbooks, are used for troubleshooting common issues. They are often created by a team.

  Write a server program using tcp that accepts requests

Write a server program using TCP that accepts requests from clients to capitalize strings sent by the clients.

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