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 18:30
Which of these options are the correct sequence of actions for content to be copied and pasted? select content, click the copy button, click the paste button, and move the insertion point to where the content needs to be inserted. click the copy button, select the content, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, click the copy button, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, move the insertion point to where the content needs to be inserted, click the copy button, and click the paste button.
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible.restrictions: branches or loops should not be used. the code must use the internal mod and logical functions.hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible.this is matlab
Answers: 2
question
Computers and Technology, 23.06.2019 11:50
While preforming before operation pmcs, you notice the front right tire appears slightly under-inflated. what is the proper action?
Answers: 3
question
Computers and Technology, 24.06.2019 00:50
Which of the following is not a key player in the sale of travel products?
Answers: 2
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, 16.01.2021 01:00
question
Health, 16.01.2021 01:00
question
Mathematics, 16.01.2021 01:00
question
Mathematics, 16.01.2021 01:00
Questions on the website: 13722362