Advertisement
Bsantos23

Funcionario

Oct 23rd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. package ficticiaLimitada;
  2.  
  3. public class Funcionario {
  4.  
  5.     /** Atributos */
  6.       private String nome;
  7.       private double horasTrabalhadasMes;
  8.       private char categoria;
  9.  
  10.  
  11.       /** Construtor */
  12.       public Funcionario(String ds_nome, char ds_categoria, double qt_horas) {
  13.         this.nome = ds_nome;
  14.         this.categoria = ds_categoria;
  15.         this.horasTrabalhadasMes = qt_horas;
  16.       }
  17.      
  18.       public Funcionario() {
  19.           this.nome = null;
  20.           this.categoria = 0;
  21.           this.horasTrabalhadasMes = 0;
  22.       }
  23.      
  24.       /** Metodos */
  25.       public String getNome() {
  26.         return this.nome;
  27.       }
  28.  
  29.       public void setNome(String newNome) {
  30.         this.nome = newNome;
  31.       }
  32.  
  33.       public double getHoras() {
  34.         return this.horasTrabalhadasMes;
  35.       }
  36.  
  37.       public void setHoras(double new_qtHoras) {
  38.         this.horasTrabalhadasMes = new_qtHoras;
  39.       }
  40.  
  41.       public char getCategoria() {
  42.         return this.categoria;
  43.       }
  44.  
  45.       public void setCategoria(char newCategoria) {
  46.         this.categoria = newCategoria;
  47.       }
  48.  
  49.       public String toString() {
  50.         return "\n> Funcionario ...........: " + this.nome + "\n> Categoria .............: " + this.categoria + "\n> Total de Horas ........: " + this.horasTrabalhadasMes;
  51.       }
  52.    
  53. } // fecha a classe Funcionario
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement