12.07.2015 Views

k19-k11-orientacao-a.. - Departamento de Sistemas e Computação

k19-k11-orientacao-a.. - Departamento de Sistemas e Computação

k19-k11-orientacao-a.. - Departamento de Sistemas e Computação

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

205 RESPOSTAS4 public abstract double calculaBonificacao ();56 // GETTERS AND SETTERS7 }Código Java 10.23: Funcionario.javaResposta do Complementar 10.7Não compila.Resposta do Complementar 10.81 class Gerente extends Funcionario {2 private String usuario ;3 private String senha ;45 public double calculaBonificacao () {6 return this . getSalario () * 0.2 + 300;7 }89 // GETTERS E SETTERS10 }Código Java 10.24: Gerente.javaResposta do Complementar 10.91 class TestaFuncionario {2 public static void main ( String [] args ) {3 Funcionario f = new Gerente ();45 f. setSalario (3000) ;67 System . out . println (f. getSalario ());89 System . out . println (f. calculaBonificacao ());10 }11 }Código Java 10.25: TestaFuncionario.javaResposta do Complementar 17.11 public class ArquivoParaArquivo {2 public static void main ( String [] args ) throws IOException {3 InputStream arquivo1 = new FileInputStream (" entrada . txt ");4 Scanner scanner = new Scanner ( arquivo1 );5www.<strong>k19</strong>.com.br 205

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!