Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class Project5E
- {
- public static void main(String[] args)
- {
- String input;
- input = JOptionPane.showInputDialog("Inset a four digit number");
- int digitInput = Integer.parseInt(input);
- char oldChar;
- oldChar = input.charAt(0);
- char oldChar1;
- oldChar1 = input.charAt(1);
- char oldChar2;
- oldChar2 = input.charAt(2);
- char oldChar3;
- oldChar3 = input.charAt(3);
- int newChar;
- newChar = (oldChar + 7);
- int newChar1;
- newChar1 = (oldChar1 + 7);
- int newChar2;
- newChar2 = (oldChar2 + 7);
- int newChar3;
- newChar3 = (oldChar3 + 7);
- System.out.print(newChar + newChar1 + newChar2 + newChar3);
- }
- }
Add Comment
Please, Sign In to add comment