import java.util.*;
class Conta {
public double saldo;
}
class ContaCorrente extends Conta {
public void deposita(double valor) {
super.saldo += (valor);
}
public Optional<Double> saca(double valor) {
if (super.saldo < valor) return Optional.empty();
super.saldo += (valor - 0.10);
return Optional.of(valor);
}
}
public class Main {
public static void main
(String[] args
) { ContaCorrente conta = new ContaCorrente();
conta.deposita(200);
var sacado = conta.saca(300);
if (sacado.
isEmpty()) System.
out.
println("O saldo nao eh suficiente para saque"); else System.
out.
println("A operação foi concluída e foi sacado " + sacado.
get()); }
}
aW1wb3J0IGphdmEudXRpbC4qOwoKY2xhc3MgQ29udGEgewoJcHVibGljIGRvdWJsZSBzYWxkbzsKfQoKY2xhc3MgQ29udGFDb3JyZW50ZSBleHRlbmRzIENvbnRhIHsKICAgIHB1YmxpYyB2b2lkIGRlcG9zaXRhKGRvdWJsZSB2YWxvcikgewogICAgICAgIHN1cGVyLnNhbGRvICs9ICh2YWxvcik7CiAgICB9CiAgICBwdWJsaWMgT3B0aW9uYWw8RG91YmxlPiBzYWNhKGRvdWJsZSB2YWxvcikgewogICAgICAgIGlmIChzdXBlci5zYWxkbyA8IHZhbG9yKSByZXR1cm4gT3B0aW9uYWwuZW1wdHkoKTsKICAgICAgICBzdXBlci5zYWxkbyArPSAodmFsb3IgLSAwLjEwKTsKICAgICAgICByZXR1cm4gT3B0aW9uYWwub2YodmFsb3IpOwogICAgfQp9CgpwdWJsaWMgY2xhc3MgTWFpbiB7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgQ29udGFDb3JyZW50ZSBjb250YSA9IG5ldyBDb250YUNvcnJlbnRlKCk7CiAgICAgICAgY29udGEuZGVwb3NpdGEoMjAwKTsKICAgICAgICB2YXIgc2FjYWRvID0gY29udGEuc2FjYSgzMDApOwogICAgICAgIGlmIChzYWNhZG8uaXNFbXB0eSgpKSBTeXN0ZW0ub3V0LnByaW50bG4oIk8gc2FsZG8gbmFvIGVoIHN1ZmljaWVudGUgcGFyYSBzYXF1ZSIpOwogICAgICAgIGVsc2UgU3lzdGVtLm91dC5wcmludGxuKCJBIG9wZXJhw6fDo28gZm9pIGNvbmNsdcOtZGEgZSBmb2kgc2FjYWRvICIgKyBzYWNhZG8uZ2V0KCkpOwogICAgfQp9