Guest User

Untitled

a guest
Jan 4th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import javax.swing.JOptionPane;
  2.  
  3.  
  4. public class Week3 {
  5.  
  6. public static void main(String[] args)
  7. {
  8. String input;
  9. input = JOptionPane.showInputDialog(null, "Bitte geben Sie einen Double Wert ein (3 Zeichen)");
  10. if (input.length() == 3);
  11. {
  12. if (input.charAt(0) >= 0 & input.charAt(0) <= 9 );
  13. {
  14. if (input.charAt(1) >= 0 & input.charAt(1) <= 9 );
  15. {
  16. if (input.charAt(2) >= 0 & input.charAt(2) <= 9 );
  17. {
  18.  
  19. }
  20. }
  21. }
  22.  
  23. else
  24. {
  25. System.out.println(input + " is not a valid (3 character) double literal");
  26. }
  27. }
  28.  
  29.  
  30. }
  31.  
  32. }
Add Comment
Please, Sign In to add comment