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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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