Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Cliente;
- public class Cliente {
- private String CPF;
- private Integer Nivel;
- public Cliente (String cpf) {
- this.CPF = cpf;
- this.Nivel = null;
- }
- public String getCPF() {
- return this.CPF;
- }
- public Integer getNivel() {
- return this.Nivel;
- }
- public void setNivel(Integer nivel) {
- this.Nivel = nivel;
- }
- }
- package Cliente;
- public class CPFInvalidoException extends Exception{
- private String CPF;
- public CPFInvalidoException (String cpf) {
- super ("O CPF" + cpf + "é invalido");
- this.CPF = cpf;
- }
- }
- package Cliente;
- public class NivelNaoDefinidoException extends Exception {
- private String CPF;
- public NivelNaoDefinidoException (String cpf) {
- super ("Nivel não definido para o cliente" + cpf);
- this.CPF = cpf;
- }
- }
- package Cliente;
- public class NivelInvalidoException extends Exception {
- public NivelInvalidoException () {
- super ("Nivel inserido invalido./nInsira 1 para o plano de 5% de desconto./nInsira 2 para o plano de 10% de desconto./nInsira 3 para o plano de 15% de desconto.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement