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, 21.06.2019 21:30
What’s the process of observing someone actually working in a career that interests you?
Answers: 1
question
Computers and Technology, 22.06.2019 08:10
Ihave a music player on my phone. i can buy songs, add them to playlists and play them. obviously it would be redundant to store each song in each playlist; each playlist is just a list of pointers to the songs. for this lab you will simulate this behavior. your program will need to have options to: add songs to the system library (you will store the text of the first line of the song, rather than the audio) add playlists add songs to a playlist list playlists play a playlist list all of the songs in the library with a count of how many times each song has been played remove a song from a playlist remove a playlist remove a song from the library (and thus from all playlists that contain it) note that we will not be checking many error cases. in real programming this would be bad, you should usually try to recognize and respond to as many types of errors as you can. in the context of class we are trying to acquaint you with as many concepts as possible, so for the sake of educational efficiency we will not be checking most errors in this lab, you may assume that your user provides correct input. you may add all appropriate error testing if you wish, but we will not be testing for it.
Answers: 2
question
Computers and Technology, 22.06.2019 22:00
What is a distinguishing feature of today’s graphic application software?) graphic applications are used today on a variety of devices, including touch-screen kiosks and mobile phones.
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
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, 02.02.2020 21:02
question
Social Studies, 02.02.2020 21:02
question
Biology, 02.02.2020 21:02
Questions on the website: 13722361