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 05:00
Pls do you believe that the use of 3d animation has grown in feature films over the last few years? if so, do you think the trend will continue? what are the forces driving this trend?
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. sean is a computer programmer. he has programmed an application for toddlers that plays nursery rhymes. however, a logic error has occurred in the program. which problem is a likely consequence of the error? a. the program crashes every time the user wants to play the nursery rhymes. b. the program crosses its buffer boundaries and overwrites an adjacent program. c. the program plays a different nursery rhyme than the one the user intended to play. d. the program shows different structures in its programming language code. e. the program introduces new viruses every time the user plays a nursery rhyme.
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Which one of the following functions is not available on the autosum tool? sum average if max
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, 09.07.2021 09:10
question
Mathematics, 09.07.2021 09:10
question
Mathematics, 09.07.2021 09:10
Questions on the website: 13722361