summaryrefslogtreecommitdiff
path: root/java/atividades/Atividade1.java
blob: e620ccc844c15ba3e7baeaa9463378d915455dca (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
import javax.swing.*;

class Atividade1
{
	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);

	}
}