ur help on my question
its nice to me to participate on this forum. frankly Im on the first steps of studying java language and i enjoy with it.
I want from you some help and I wish to see the helping from java-forum members.
my question is how to write a program for this matter....?
The main idea is using Caesar cipher.
"The transformation can be represented by aligning two alphabets; the cipher alphabet is the plain alphabet rotated left or right by some number of positions. For instance, here is a Caesar cipher using a left rotation of three places (the shift parameter, here 3, is used as the key):
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC"
An example for that:
Plaintext: the quick brown fox jumps over the lazy dog
Ciphertext: WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ
Cipher Key is:
Encryption = Plaintext + 3
Decryption = Ciphertext – 3
Im waiting 4 ur replays
Best Regards, :)
That description tells you how to do it. You need to at least attempt to do your own homework.
Post the code you come up with, along with all complete error/compiler message and a description of the current behaviour as it relates to the expected behaviour.
We are not going to do your homework for you.
Originally Posted by masijade
i did not ask u to write the codes!!!!!!! just i want the main keys
I would start with a design first, then look to see what was needed. Rather that jump into the code. The collections class may holds some useful methods.
Then I will give the only hint that might be useful (in addition to what the assignment already tells you). Use an array and either a switch statement or a Map (for a letter's original position).
For anything more, you are going to have to show some effort.
And, for the record, yes you did ask us to do it for you. At the very least, that is what you wer hoping for without having put it into so many words (and done purposely so you could claim to not have asked that when called out on it, which is exactly what happened).
When you say "how do I write this program ..." and then copy and paste your homework assignment, what would you call it? Except a "do my homework for me" request?
If you want an honest answer to "how do I write this program ...", I would say "use a text editor".