import java.util.Scanner;
class Main {
public static void main
(String[] args
) { Scanner sc
= new Scanner
(System.
in); System.
out.
println("Informe dois valores: "); Calculadora calc = new Calculadora(sc.nextDouble(), sc.nextDouble());
System.
out.
println(calc.
soma()); System.
out.
println(calc.
subtracao()); System.
out.
println(calc.
multiplicacao()); System.
out.
println(calc.
divisao()); }
}
class Calculadora {
protected double x;
protected double y;
Calculadora(double x, double y) {
this.x = x;
this.y = y;
}
double soma() {
return x + y;
}
double subtracao() {
return x - y;
}
double multiplicacao() {
return x * y;
}
double divisao() {
return x / y;
}
}
//https://pt.stackoverflow.com/q/254244/101
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKY2xhc3MgTWFpbiB7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykJewoJCVNjYW5uZXIgc2MgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCVN5c3RlbS5vdXQucHJpbnRsbigiSW5mb3JtZSBkb2lzIHZhbG9yZXM6ICIpOwoJCUNhbGN1bGFkb3JhIGNhbGMgPSBuZXcgQ2FsY3VsYWRvcmEoc2MubmV4dERvdWJsZSgpLCBzYy5uZXh0RG91YmxlKCkpOwoJCVN5c3RlbS5vdXQucHJpbnRsbihjYWxjLnNvbWEoKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKGNhbGMuc3VidHJhY2FvKCkpOwoJCVN5c3RlbS5vdXQucHJpbnRsbihjYWxjLm11bHRpcGxpY2FjYW8oKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKGNhbGMuZGl2aXNhbygpKTsKCX0KfQoKY2xhc3MgQ2FsY3VsYWRvcmEgewoJcHJvdGVjdGVkIGRvdWJsZSB4OwoJcHJvdGVjdGVkIGRvdWJsZSB5OwoKCUNhbGN1bGFkb3JhKGRvdWJsZSB4LCBkb3VibGUgeSkgewoJCXRoaXMueCA9IHg7CgkJdGhpcy55ID0geTsKCX0KCWRvdWJsZSBzb21hKCkgewoJICAgIHJldHVybiB4ICsgeTsKCX0KCWRvdWJsZSBzdWJ0cmFjYW8oKSB7CgkgICAgcmV0dXJuIHggLSB5OwoJfQoJZG91YmxlIG11bHRpcGxpY2FjYW8oKSB7CgkgICAgcmV0dXJuIHggKiB5OwoJfQoJZG91YmxlIGRpdmlzYW8oKSB7CgkgICAgcmV0dXJuIHggLyB5OwoJfQp9CgovL2h0dHBzOi8vcHQuc3RhY2tvdmVyZmxvdy5jb20vcS8yNTQyNDQvMTAx