Skip to main content



      Home
Home » Newcomers » Newcomers » Need HELP w/ Assignment..(developing a code for encryption)
Need HELP w/ Assignment.. [message #524125] Tue, 30 March 2010 16:37 Go to next message
Eclipse UserFriend
My assignment is to:

Develop code to encrypt a string given the following encryption key "DEFGHIJKLMNOPQRSTUVWXYZABC". The encryption key is positional, so that the letter A is replaced by D, B is replaced by E, etc. We will ignore case in our substitutions.

To implement Stage 1, you should write a static method named encrypt :

public static String encrypt(String text, String theKey)

This method takes in the string to encrypt and the key and returns the encrypted string.

Also, there are some steps to help me out with this, but i still don't udnerstand how to start this because im quite new :-/
Re: Need HELP w/ Assignment.. [message #524130 is a reply to message #524125] Tue, 30 March 2010 16:53 Go to previous messageGo to next message
Eclipse UserFriend
here is the "helpful" steps:

Inside the method, create a new string which is a lower case version of the parameter "text". We will replace the lower case characters with upper case key characters from the key so as to avoid the problem of replacing a character twice.
Create a loop that considers each character of the key (loop 26 times). Inside the loop :
extract the ith character from the key using the string method charAt.
extract the ith character from ALPHABET
call the replace method of the lower case text, changing the ith character of the alphabet to the ith character of the key.
Re: Need HELP w/ Assignment.. [message #524131 is a reply to message #524125] Tue, 30 March 2010 12:02 Go to previous messageGo to next message
Eclipse UserFriend
On 3/30/2010 2:37 PM, Ben Sewards wrote:
> My assignment is to:
>
> Develop code to encrypt a string given the following encryption key
> "DEFGHIJKLMNOPQRSTUVWXYZABC". The encryption key is positional, so that
> the letter A is replaced by D, B is replaced by E, etc. We will ignore
> case in our substitutions.
> To implement Stage 1, you should write a static method named encrypt :
> public static String encrypt(String text, String theKey)
> This method takes in the string to encrypt and the key and returns the
> encrypted string.
> Also, there are some steps to help me out with this, but i still don't
> udnerstand how to start this because im quite new :-/

Friend,

Don't wait for an answer here. Use Google instead. This forum is for
helping newcomers to Eclipse learn and overcome Eclipse problems not
mere Java ones. I would suggest JavaRanch (http://www.javaranch.com/),
or JGuru (http://www.jguru.com/) or other such forums.
Re: Need HELP w/ Assignment.. [message #524153 is a reply to message #524125] Tue, 30 March 2010 19:31 Go to previous messageGo to next message
Eclipse UserFriend
Ben Sewards wrote:
> My assignment is to:
>
> Develop code to encrypt a string given the following encryption key
> "DEFGHIJKLMNOPQRSTUVWXYZABC". The encryption key is positional, so that
> the letter A is replaced by D, B is replaced by E, etc. We will ignore
> case in our substitutions.
> To implement Stage 1, you should write a static method named encrypt :
> public static String encrypt(String text, String theKey)
> This method takes in the string to encrypt and the key and returns the
> encrypted string.
> Also, there are some steps to help me out with this, but i still don't
> udnerstand how to start this because im quite new :-/
It is frowned upon to ask people to do your homework for you. You
should ask your instructor or teaching assistant for help.
Re: Need HELP w/ Assignment.. [message #524155 is a reply to message #524153] Tue, 30 March 2010 19:46 Go to previous messageGo to next message
Eclipse UserFriend
Im not asking for anyone to do my homework for me. Im in a begginer COS class in college and most of the time, during assignments, i have a problem starting the program myself.

I have emailed my instructor, but he has not responded, so as of now I am in dire need of someone to help kickstart my assignment with me.

But i'll just switch forums anyways, i'm not going to get any help here.

Re: Need HELP w/ Assignment.. [message #524583 is a reply to message #524153] Thu, 01 April 2010 09:58 Go to previous message
Eclipse UserFriend
In article <hou1js$bh8$2@build.eclipse.org>, dpwegener@gmail.com says...
>
> Ben Sewards wrote:
> > My assignment is to:
> >
> > Develop code to encrypt a string given the following encryption key
> > "DEFGHIJKLMNOPQRSTUVWXYZABC". The encryption key is positional, so that
> > the letter A is replaced by D, B is replaced by E, etc. We will ignore
> > case in our substitutions.
> > To implement Stage 1, you should write a static method named encrypt :
> > public static String encrypt(String text, String theKey)
> > This method takes in the string to encrypt and the key and returns the
> > encrypted string.
> > Also, there are some steps to help me out with this, but i still don't
> > udnerstand how to start this because im quite new :-/

> It is frowned upon to ask people to do your homework for you. You
> should ask your instructor or teaching assistant for help.

Agreed, but at least he told us it was a homework assignment, and didn't
try to say "My boss wants me to ...". Though in this case, it's pretty
obvious...

D
Previous Topic:Linked Resources
Next Topic:Difference between isNatureEnabled and hasNature !?
Goto Forum:
  


Current Time: Fri Nov 07 01:36:29 EST 2025

Powered by FUDForum. Page generated in 0.09068 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top