Created
November 10, 2011 15:37
-
-
Save nmelox/1355149 to your computer and use it in GitHub Desktop.
Sistema Laboratorio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Analisis { | |
private String Descripcion; | |
private int Precio; | |
/** | |
* @return the Descripcion | |
*/ | |
public String getDescripcion() { | |
return Descripcion; | |
} | |
/** | |
* @param Descripcion the Descripcion to set | |
*/ | |
public void setDescripcion(String Descripcion) { | |
this.Descripcion = Descripcion; | |
} | |
/** | |
* @return the Precio | |
*/ | |
public int getPrecio() { | |
return Precio; | |
} | |
/** | |
* @param Precio the Precio to set | |
*/ | |
public void setPrecio(int Precio) { | |
this.Precio = Precio; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PAMI extends ObraSocial { | |
public float obtenerPrecio (int valor){ | |
float precioFinal; | |
precioFinal = valor - valor * getCobertura(); | |
return precioFinal; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Particular extends ObraSocial { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sistemalab; | |
import Clases.Analisis; | |
import Clases.ObraSocial; | |
import Clases.PAMI; | |
import Clases.Particular; | |
/** | |
* | |
* @author nahuel.melo | |
*/ | |
public class SistemaLab { | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) { | |
int arrayPrecio [] = {50,150,200,300,25}; | |
String arrayNombre [] = { "Uno","Dos","Tres","Cuatro","Cinco"}; | |
PAMI os1 = new PAMI(); | |
os1.setCobertura(50); | |
os1.setNombre("PAMI"); | |
Analisis a = new Analisis(); | |
a.setPrecio(100); | |
System.out.println(os1.OS_CONST + os1.getNombre()); | |
System.out.println("Precio: "+ os1.obtenerPrecio(a.getPrecio())+ "$"); | |
for (int i=0; i < 5; i++){ | |
Particular p = new Particular(); | |
p.setNombre(arrayNombre[i]); | |
System.out.println(p.OS_CONST + p.getNombre()); | |
System.out.println("Precio: "+ p.obtenerPrecio(arrayPrecio[i])); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment