-5
my colleagues good night I help myself here , I am doing a job for college , I am beginner in Java , I can not pass I have 2 class 1 -patient 2 doctor, the medical class is already with patient extends , but I can not pass the patient name to the medical class
public void receita () {
if (this.consultaMedica == "dor de cabeça") {
System.out.println ("\nPrescrição: O paciente " + getNomeDoPaciente () + " está com foi marcado com o remédio dipirona");
and also I can’t get date date that this in the secret class oara aclasse patient
public void data(int dia, int mes,int ano) {
data = ( dia +"/" + mes + "/" + ano);
}
public class Paciente {
private String nomeDoPaciente;
private int idadeDoPaciente;
private String cpfDoPaciente;
public class Secretaria {
private String nomeCompleto;
private double valorDaConsulta = 360.77; //so coloquei esse centavos ai pra formatar a casa decimail , mas so o printf que faz porém não concatena 2 frases, depois vc me explica a fiferença de prinF e printLN
String Consulta;
String data;
public void data(int dia, int mes,int ano) {
data = ( dia +"/" + mes + "/" + ano);
}
]public void mostrarPaciente(){
System.out.printf("\nCadastro do Paciente"+"\n===INFORMAÇÕES DO PACIENTE==="+
"\nNome do paciente: " + getNomeDoPaciente() +"\n"+
"Idade do paciente: "+ getIdadeDoPaciente() + "\n"+
"CPF: " + getCpfDoPaciente()+ "\nData agendada: "+getDataInicio())
This is the Stack in young Portuguese, translates your question.
– user28595
Please post the doubt in Portuguese and format the code to the point where it is readable
– Jefferson Quesado
apologies..........
– Gilliard Pacheco
Look, I tried to save your question by translating and formatting it, but clearly the resulting code is so incomplete and disorganized that it’s not something very usable. I suggest posting a code that is at least compileable (edit the question to do this).
– Victor Stafusa
And it’s worth the tip I gave in the answer to your other question about using
==
with strings: https://answall.com/q/3905/132– Victor Stafusa
"the medical class is already with patient extends" - don’t do it! The
extends
that is to say "is a". It is incorrect to say that a doctor is a patient, and therefore, if you program like this, your program will not come out what you expect.– Victor Stafusa
Related question (not duplicate): https://answall.com/q/251819/132
– Victor Stafusa