Guest User

Untitled

a guest
Oct 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. package secondPdf;
  2.  
  3. import javax.swing.*;
  4. import javax.swing.plaf.FontUIResource;
  5. import java.awt.*;
  6.  
  7. import static javax.swing.JOptionPane.INFORMATION_MESSAGE;
  8. import static javax.swing.JOptionPane.showInputDialog;
  9. import static javax.swing.JOptionPane.showMessageDialog;
  10.  
  11. /**
  12. * Created by Kurnosova Iryna on 30.09.2017.
  13. */
  14. public class DividingByThree {
  15. public static void main(String[] args) {
  16. int inputDigit, result;
  17. String inp;
  18. UIManager.put("OptionPane.messageFont", new FontUIResource("SERIF", Font.ITALIC, 19));
  19. UIManager.put("OptionPane.buttonFont", new FontUIResource("ARIAL", Font.ITALIC, 15));
  20. inp = showInputDialog(null, "Enter the digit", "Initial digit", INFORMATION_MESSAGE);
  21. inputDigit = Integer.parseInt(inp);
  22. if(inputDigit%3 == 0){
  23. showMessageDialog(null, "This digit is divided by 3 without remainder", "dividing the digit", JOptionPane.INFORMATION_MESSAGE);
  24. } else {
  25. showMessageDialog(null, "This digit is divided by 3 with a remainder ", "dividing the digit", JOptionPane.ERROR_MESSAGE);
  26. }
  27. }
  28. }
Add Comment
Please, Sign In to add comment