King_Weaver
Gawd
- Joined
- Nov 26, 2006
- Messages
- 620
hello so Im taking my first java programming class this semester and I have no idea what im doing. Anyway so the problem I have for hw reads "Write a program that reads a sentence from a dialog box. The sentence has been encrypted as follows: only the first five even-numbered characters should be counted; all other characters should be discarded. Decrypt the sentence and output the results. For example, if the user inputs 'Hiejlzl3ow', your output should be 'Hello'."
so all I can figure out how to do is create the input and output dialoge boxes, I have no idea how to go about decrypting the message. Anyway heres what ive got so far.
import javax.swing.JOptionPane;
public class Project2
{
public static void main(String[] args)
{
String encryptedmessage = JOptionPane.showInputDialog(null,"Please input the encrypted message");
JOptionPane.showMessageDialog(null,encryptedmessage);
}
}
so all I can figure out how to do is create the input and output dialoge boxes, I have no idea how to go about decrypting the message. Anyway heres what ive got so far.
import javax.swing.JOptionPane;
public class Project2
{
public static void main(String[] args)
{
String encryptedmessage = JOptionPane.showInputDialog(null,"Please input the encrypted message");
JOptionPane.showMessageDialog(null,encryptedmessage);
}
}