Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class Week3 {
- public static void main(String[] args)
- {
- String input;
- input = JOptionPane.showInputDialog(null, "Bitte geben Sie einen Double Wert ein (3 Zeichen)");
- if (input.length() == 3);
- {
- if (input.charAt(0) >= 0 & input.charAt(0) <= 9 );
- {
- if (input.charAt(1) >= 0 & input.charAt(1) <= 9 );
- {
- if (input.charAt(2) >= 0 & input.charAt(2) <= 9 );
- {
- }
- }
- }
- else
- {
- System.out.println(input + " is not a valid (3 character) double literal");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment