Created
December 20, 2011 21:15
-
-
Save alexduarte/1503308 to your computer and use it in GitHub Desktop.
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 ImpostoMuitoAlto extends Imposto { | |
public ImpostoMuitoAlto(Imposto outroImposto) { | |
super(outroImposto); | |
} | |
public ImpostoMuitoAlto() { | |
} | |
public double calcula(Orcamento orcamento) { | |
return orcamento.getValor()*0.2 + calculoDoOutroImposto(orcamento); | |
} | |
} | |
public class TestaImpostoComplexo { | |
public static void main(String[] args) { | |
Imposto higherIp = new ImpostoMuitoAlto(new ISS(new ICMS())); | |
Orcamento orcamento = new Orcamento(500); | |
double valor = higherIp.calcula(orcamento); | |
System.out.println(valor); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment