Ask your own question, for FREE!
Computer Science 13 Online
OpenStudy (mokeira):

Help!!! This is really stressing me out. I want to create a program on java to change some numbers to something and vice versa but i have no clue where or how to start

OpenStudy (e.mccormick):

Do you know anything about Java?

OpenStudy (mokeira):

just the basics ;(

OpenStudy (mokeira):

i know a bunch of stuff but putting them into practise is hard

OpenStudy (e.mccormick):

OK, so you have the JDK and a way to work with it? Have an IDE or using command line stuff?

OpenStudy (mokeira):

i have IDE

OpenStudy (mokeira):

netbeans

OpenStudy (e.mccormick):

OK. So what something are you trying to change the numbers into?

OpenStudy (mokeira):

ok...let me try paraphrase it a bit. i have a st of various numbers. I am needed to make a program that -reads a string of text containing these numbers form keyboard...is this where i intro scanner? -rewrite the string with dashes..... -encrypt theses numbers using a given algorithm

OpenStudy (mokeira):

does that make sense.. i hope i havent confused you

OpenStudy (e.mccormick):

OK. Hmm... So, you are starting with text (it is 1234567890, but it is still text), edit it to use dashes, then use some sort of encryption. If you are going to use dashes, well, then you never need to use any numbers. You could just leave it as text.

OpenStudy (mokeira):

lol...still processing but thanks!!! let me give this a try :)

OpenStudy (e.mccormick):

Well, ebery character is text. a, d, 4, j, 8, and so on. They are all just text of some sort or another. Now, the ones like 8, 5, 3.1415, etc. have other, special meanings as "numbers" too. So if you use them as numbers in a computer program you can do other things, like math. But if you just need to look at it as text to be encoded somehow, then there is no reason to tell the computer to look at it as numbers.

OpenStudy (mokeira):

hmmm.... yeah. I am starting to see your point. i never thought of it like that

OpenStudy (e.mccormick):

And, thanks to the ASCII table, you can still assign numeric values to these for when you want to deal with them. It all comes down to what algorithm you need to use and how it will do encoding. For example, you could look at the ASCII value of each character and multiply it by a matrix. Then use the inverse matrix to later decode things.

OpenStudy (mokeira):

woah!!!! cool

OpenStudy (mokeira):

ok...do you mind if i tag you here later...in case i get stuck?

OpenStudy (e.mccormick):

Sure. At least now you have some things to play with to see what you get.

OpenStudy (mokeira):

i was so bored with this but for some reason you have made me feel psyched up!!! thanks .... tag u i a few hours lol

OpenStudy (e.mccormick):

Matrices for encryption: http://aix1.uottawa.ca/~jkhoury/cryptography.htm And you could use the ASCII value of the numbers, and the dash, as the number values you run through the matrix. Hehe. That is one way to do this. There are some others.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!