Advertisement
hercioneto

Classe Cigarros

Nov 27th, 2023
950
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. /* criar classe Cigarros e colar abaixo do packpage */
  2. /**
  3.  *
  4.  * @author Professor Hercio Neto
  5.  */
  6. public class Cigarros {
  7.  
  8.     private Integer quantidade;
  9.     private Integer anos;
  10.     private Double tempo = 10d;
  11.     private Double diasPerdidos;
  12.    
  13.  
  14.     public Integer getQuantidade() {
  15.         return quantidade;
  16.     }
  17.  
  18.     public void setQuantidade(Integer quantidade) {
  19.         this.quantidade = quantidade;
  20.     }
  21.  
  22.     public Integer getAnos() {
  23.         return anos;
  24.     }
  25.  
  26.     public void setAnos(Integer anos) {
  27.         this.anos = anos;
  28.     }
  29.    
  30.     public Double getDiasPerdidos() {
  31.         return diasPerdidos;
  32.     }
  33.  
  34.     public void setdiasPerdidos() {
  35.         Integer cigarrosAnos = this.getQuantidade()*(this.getAnos()*365);
  36.         this.diasPerdidos = (cigarrosAnos/this.tempo)/24;
  37.     }
  38.    
  39.  
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement