import java.util.ArrayList;
import java.util.Scanner;
class App {
Scanner entrada
= new Scanner
(System.
in); public static ArrayList<Cliente> clientes;
public static void main
(String[] args
) {
System.
out.
println("|||||Clínica Veterinária 1.0|||||\n\n");
int opcao = 0;
switch(opcao){
case 1:
clientes.add(new Cliente(nome, cpf));
break;
case 2:
String nomeCat
= null; double pesoCat
= 0.0; int idadeCat
= 0; clientes.get(0).adicionaFelino(nomeCat, idadeCat, pesoCat);
break;
default:
return;
}
}
}
abstract class Animal {
protected double peso;
public double calculaAnestesia(){
double ml = 0.0;
ml = peso*0.3;
return ml;
}
}
class Felino extends Animal {
private int idade;
public Felino
(String nome,
int idade,
double peso
){ this.nome = nome;
this.peso = peso;
this.idade = idade;
}
return nome;
}
public void setNome
(String nome
) { this.nome = nome;
}
public int getIdade() {
return idade;
}
public void setIdade(int idade) {
this.idade = idade;
}
public double getPeso(){
return peso;
}
public void setPeso(double peso){
this.peso = peso;
}
}
class Canino extends Animal{
private int idade;
public Canino
(String nome,
int idade,
double peso
){ this.peso = peso;
this.nome = nome;
this.idade = idade;
}
return nome;
}
public void setNome
(String nome
) { this.nome = nome;
}
public int getIdade() {
return idade;
}
public void setIdade(int idade) {
this.idade = idade;
}
public double getPeso(){
return peso;
}
public void setPeso(double peso){
this.peso = peso;
}
}
class Cliente {
private ArrayList<Animal> animais;
this.nome = nome;
this.cpf = cpf;
}
return nome;
}
public void setNome
(String nome
) { this.nome = nome;
}
return cpf;
}
public void setCpf
(String cpf
) { this.cpf = cpf;
}
public ArrayList
<Felino
> adicionaFelino
(String nomeGato,
int idade,
double peso
){ animais.add(new Felino(nomeGato, idade, peso));
return null;
}
public String adicionaCanino
(String nomeCao,
int idade,
double peso
){ animais.add(new Canino(nomeCao, idade, peso));
return("animal adicionado");
}
}
aW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CmltcG9ydCBqYXZhLnV0aWwuU2Nhbm5lcjsKCmNsYXNzIEFwcCB7CgogICAgU2Nhbm5lciBlbnRyYWRhID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgIHB1YmxpYyBzdGF0aWMgQXJyYXlMaXN0PENsaWVudGU+IGNsaWVudGVzOwoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKCiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJ8fHx8fENsw61uaWNhIFZldGVyaW7DoXJpYSAxLjB8fHx8fFxuXG4iKTsKCiAgICAgICAgaW50IG9wY2FvID0gMDsKICAgICAgICBzd2l0Y2gob3BjYW8pewogICAgICAgIGNhc2UgMToKICAgICAgICAgICAgU3RyaW5nIG5vbWUgPSBudWxsOwogICAgICAgICAgICBTdHJpbmcgY3BmID0gbnVsbDsKICAgICAgICAgICAgY2xpZW50ZXMuYWRkKG5ldyBDbGllbnRlKG5vbWUsIGNwZikpOwogICAgICAgICAgICBicmVhazsKICAgICAgICBjYXNlIDI6CiAgICAgICAgICAgIFN0cmluZyBub21lQ2F0ID0gbnVsbDsgZG91YmxlIHBlc29DYXQgPSAwLjA7IGludCBpZGFkZUNhdCA9IDA7CiAgICAgICAgICAgIGNsaWVudGVzLmdldCgwKS5hZGljaW9uYUZlbGlubyhub21lQ2F0LCBpZGFkZUNhdCwgcGVzb0NhdCk7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGRlZmF1bHQ6ICAgIAogICAgICAgIAlyZXR1cm47CiAgICAgICAgfQogICAgfQp9CgphYnN0cmFjdCBjbGFzcyBBbmltYWwgewoKICAgIHByb3RlY3RlZCBkb3VibGUgcGVzbzsKCiAgICBwdWJsaWMgZG91YmxlIGNhbGN1bGFBbmVzdGVzaWEoKXsKICAgICAgICBkb3VibGUgbWwgPSAwLjA7CiAgICAgICAgbWwgPSBwZXNvKjAuMzsKICAgICAgICByZXR1cm4gbWw7CiAgICB9Cn0KCmNsYXNzIEZlbGlubyBleHRlbmRzIEFuaW1hbCB7CgogICAgcHJpdmF0ZSBTdHJpbmcgbm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CgogICAgcHVibGljIHZvaWQgc2V0Tm9tZShTdHJpbmcgbm9tZSkgewogICAgICAgIHRoaXMubm9tZSA9IG5vbWU7CiAgICB9CgogICAgcHVibGljIGludCBnZXRJZGFkZSgpIHsKICAgICAgICByZXR1cm4gaWRhZGU7CiAgICB9CgogICAgcHVibGljIHZvaWQgc2V0SWRhZGUoaW50IGlkYWRlKSB7CiAgICAgICAgdGhpcy5pZGFkZSA9IGlkYWRlOwogICAgfQoKICAgIHB1YmxpYyBkb3VibGUgZ2V0UGVzbygpewogICAgICAgIHJldHVybiBwZXNvOwogICAgfQoKICAgIHB1YmxpYyB2b2lkIHNldFBlc28oZG91YmxlIHBlc28pewogICAgICAgIHRoaXMucGVzbyA9IHBlc287CiAgICB9Cn0KCmNsYXNzIENsaWVudGUgewoKICAgIHByaXZhdGUgU3RyaW5nIG5vbWUsIGNwZjsKICAgIHByaXZhdGUgQXJyYXlMaXN0PEFuaW1hbD4gYW5pbWFpczsKCiAgICBwdWJsaWMgQ2xpZW50ZShTdHJpbmcgbm9tZSwgU3RyaW5nIGNwZil7CiAgICAgICAgdGhpcy5ub21lID0gbm9tZTsKICAgICAgICB0aGlzLmNwZiA9IGNwZjsKICAgIH0KCiAgICBwdWJsaWMgU3RyaW5nIGdldE5vbWUoKSB7CiAgICAgICAgcmV0dXJuIG5vbWU7CiAgICB9CgogICAgcHVibGljIHZvaWQgc2V0Tm9tZShTdHJpbmcgbm9tZSkgewogICAgICAgIHRoaXMubm9tZSA9IG5vbWU7CiAgICB9CgogICAgcHVibGljIFN0cmluZyBnZXRDcGYoKSB7CiAgICAgICAgcmV0dXJuIGNwZjsKICAgIH0KCiAgICBwdWJsaWMgdm9pZCBzZXRDcGYoU3RyaW5nIGNwZikgewogICAgICAgIHRoaXMuY3BmID0gY3BmOwogICAgfQoKICAgIHB1YmxpYyBBcnJheUxpc3Q8RmVsaW5vPiBhZGljaW9uYUZlbGlubyhTdHJpbmcgbm9tZUdhdG8sIGludCBpZGFkZSwgZG91YmxlIHBlc28pewogICAgICAgIGFuaW1haXMuYWRkKG5ldyBGZWxpbm8obm9tZUdhdG8sIGlkYWRlLCBwZXNvKSk7CiAgICAgICAgcmV0dXJuIG51bGw7CiAgICB9CgogICAgcHVibGljIFN0cmluZyBhZGljaW9uYUNhbmlubyhTdHJpbmcgbm9tZUNhbywgaW50IGlkYWRlLCBkb3VibGUgcGVzbyl7CiAgICAgICAgYW5pbWFpcy5hZGQobmV3IENhbmlubyhub21lQ2FvLCBpZGFkZSwgcGVzbykpOwogICAgICAgIHJldHVybigiYW5pbWFsIGFkaWNpb25hZG8iKTsKICAgIH0KfQ==