private int Centigrados;
private int Farenheit;
public Double CaF(){
return (1.8*Centigrados)+32;
}
public Double FaC(){
return (Farenheit-32)*(0.55);
}
public void setF(int Farenheit){
this.Farenheit=Farenheit;
}
public void setC(int Centigrados){
this.Centigrados=Centigrados;
}
}
-------------------------------------------------------------------------------------------
public class Mtemperatura{
public static void main(String[]arg){
Temperatura te=new Temperatura();
te.setC(30);
te.setF(86);
System.out.println("\n 86 farenheit a centigardos=" +te.FaC()+"\n 30 centigrados a ferenheit=" +te.CaF());
}
}
No hay comentarios:
Publicar un comentario