subject

For this assignment you will design a class and a driver program that uses the two modifier methods of the class and demonstrates how strings can be encrypted and Decrypted using objects of the class that is designed. The two modifier methods that you should have as part of your class design are:
1. cypherMethod() takes a string that is passed as a parameter through the overloaded constructor or provided by the default constructor and returns the characters in the odd positions, followed by the even positions.
For example: If the original message is "Attack at Dawn", then you should print out "Atc tDwtaka an". This is a crude form of cryptography.
2. Your second method reverses the string returned by the earlier described modifier. reverseMethod() takes in a message encoded using the cypherMethod() or any string that is provided through the overloaded constructor and returns the encrypted string.
Your class should contain all needed attributes including a private variable string which is to be used for the encryption, a default constructor and an overloaded constructor as well as a toString. Implement all set methods and get methods as needed. All input/output statements should be in the driver program.
Cypher class should include the following:
A variable named original to store the passed message
A variable named encrypted to store the encrypted message
A variable named decrypted to store the decrypted message (notice it should be the same as original message)
A default constructor that employs the word "cypher" for encryption
An overloaded constructor that employs a word of your choice that gets passed as parameter
The encryption method named cypherMethod()for producing the encrypted message
The encryption method named reverseMethod() for producing the decrypted message
A toString()method that prints the encrypted and decrypted message to screen
Getter methods for all variables
Setter methods for variables that should be accessible from outside
testCypher program should instantiate two cypher objects: one using the default constructor and one that employs the overloaded constructor. Test the encryption, decryption and toString methods on each and print output to screen.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:00
Robots with telescoping arms are sometimes used to perform tasks (e.g., welding or placing screws) where access may be difficult for other robotic types. during a test run, a robot arm is programmed to extend according to the relationship r = 3 + 0.5cos(4θ) and the arm rotates according to the relationship θ=−π4t2+πt , where r is in feet, θ is in radians, and t is in seconds. use a computer program to plot the path of tip a in x and y coordinates for 0 ≤ t ≤ 4s.
Answers: 2
question
Computers and Technology, 24.06.2019 00:20
The guy wire bd exerts on the telephone pole ac a force p directed along bd. knowing the p must have a 720-n component perpendicular to the pole ac, determine the magnitude of force p and its component along line ac.
Answers: 2
question
Computers and Technology, 24.06.2019 23:30
Does anyone have the problem where you try to watch a video to get your answer but it brings up a thing asking your gender to make ads relevant but it doesn't load? btw i won't be able to see the answer so use the comments .
Answers: 1
question
Computers and Technology, 25.06.2019 08:20
The process of representing data in digital form so it can be used by a digital computer is called decimal byterepresentation. - true or false
Answers: 3
You know the right answer?
For this assignment you will design a class and a driver program that uses the two modifier methods...
Questions
question
Mathematics, 24.11.2020 19:00
question
Biology, 24.11.2020 19:00
question
Mathematics, 24.11.2020 19:00
question
Mathematics, 24.11.2020 19:00