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 ar.edu.untref.pruebas; | |
public class CajaDeAhorros { | |
private String titular; | |
private double saldo = 0.0; | |
public CajaDeAhorros(String titular) { | |
this.titular = titular; | |
} |
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 ar.edu.untref.pruebas; | |
public class Nota { | |
private int nota; | |
public Nota(int nota) { | |
if (nota >=0 && nota <=10) { | |
this.nota = nota; | |
} else { |
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
function esCUITValida(inputValor) { | |
inputString = inputValor.toString() | |
if (inputString.length == 11) { | |
var Caracters_1_2 = inputString.charAt(0) + inputString.charAt(1) | |
if (Caracters_1_2 == "20" || Caracters_1_2 == "23" || Caracters_1_2 == "24" || Caracters_1_2 == "27" || Caracters_1_2 == "30" || Caracters_1_2 == "33" || Caracters_1_2 == "34") { | |
var Count = inputString.charAt(0) * 5 + inputString.charAt(1) * 4 + inputString.charAt(2) * 3 + inputString.charAt(3) * 2 + inputString.charAt(4) * 7 + inputString.charAt(5) * 6 + inputString.charAt(6) * 5 + inputString.charAt(7) * 4 + inputString.charAt(8) * 3 + inputString.charAt(9) * 2 + inputString.charAt(10) * 1 | |
Division = Count / 11; | |
if (Division == Math.floor(Division)) { | |
return true | |
} |
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
#!/bin/bash | |
pipo=`ps aux | grep pipo | wc -l` | |
if [ "$pipo" = "1" ] | |
then | |
echo "yeah!"; | |
else | |
echo "ouch!"; | |
fi |
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 Cilindro { | |
private Double altura; | |
private Circulo base; | |
public void setAltura(Double altura) { | |
this.altura = altura; | |
} | |
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 enum Escala { | |
FAHRENHEIT, CELSIUS, KELVIN | |
} |
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 ar.edu.unlam.tallerweb.billetera; | |
public class BilleteException extends Exception { | |
private static final long serialVersionUID = 8656459465486574L; | |
public BilleteException(String message){ | |
super(message); | |
} | |
} |
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
class ExceptionTestsJUnit3 extends GroovyTestCase { | |
void testDebeArrojarArithmeticExcepcion() { | |
shouldFail(ArithmeticException) { | |
1 / 0 | |
} | |
} | |
} |
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 BuscadorBinario { | |
public int buscadorBinarioSimple (ArregloOrdenable arreglo, int buscado){ | |
int posicionDelValorBuscado = 0; | |
int posicionMenor = 0; | |
int posicionMayor = arreglo.getLargo()-1; | |
int promedio = calcularPromedio(posicionMenor, posicionMayor); | |
boolean encontrado = false; |
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 ArregloOrdenable { | |
public static final int COSTO_ELEMENTO = 5; | |
public static final int COSTO_INTERCAMBIO = 10; | |
public static final int COSTO_LARGO = 15; | |
private int[] arreglo; | |
private int peticionesElemento; | |
private int peticionesIntercambio; |