blob: ea9407008aad2b6372b7b6f46a6eaa969fceaf92 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
import javax.swing.*;
class test_swing
{
public static void main(String args[])
{
int num1, num2;
double div, pow;
String msg = "";
num1 = Integer.parseInt(JOptionPane.showInputDialog("Digite o primeiro numero:"));
num2 = Integer.parseInt(JOptionPane.showInputDialog("Digite o segundo numero:"));
div = (int)num1 / (int)num2;
pow = Math.pow(num1, num2);
msg = msg + " Resultado das operacoes: \n";
msg = msg + "Quociente: " + div + "\n";
msg = msg + "Potencia de " + num1 + " elevado a " + num2 + ": " + pow + "\n";
msg = msg + "\n";
JOptionPane.showMessageDialog(null, msg);
System.exit(0);
}
}
|