Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package secondPdf;
- import javax.swing.*;
- import javax.swing.plaf.FontUIResource;
- import java.awt.*;
- import static javax.swing.JOptionPane.INFORMATION_MESSAGE;
- import static javax.swing.JOptionPane.showInputDialog;
- import static javax.swing.JOptionPane.showMessageDialog;
- /**
- * Created by Kurnosova Iryna on 30.09.2017.
- */
- public class DividingByThree {
- public static void main(String[] args) {
- int inputDigit, result;
- String inp;
- UIManager.put("OptionPane.messageFont", new FontUIResource("SERIF", Font.ITALIC, 19));
- UIManager.put("OptionPane.buttonFont", new FontUIResource("ARIAL", Font.ITALIC, 15));
- inp = showInputDialog(null, "Enter the digit", "Initial digit", INFORMATION_MESSAGE);
- inputDigit = Integer.parseInt(inp);
- if(inputDigit%3 == 0){
- showMessageDialog(null, "This digit is divided by 3 without remainder", "dividing the digit", JOptionPane.INFORMATION_MESSAGE);
- } else {
- showMessageDialog(null, "This digit is divided by 3 with a remainder ", "dividing the digit", JOptionPane.ERROR_MESSAGE);
- }
- }
- }
Add Comment
Please, Sign In to add comment