Advertisement
andresnogales

PrimeFactor.java

Oct 27th, 2021
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. //Grupo 2.3
  2.  
  3. public class PrimeFactor {
  4.     private Integer base;
  5.     private Integer exponent;
  6.    
  7.     public PrimeFactor() {
  8.     }
  9.  
  10.     public PrimeFactor(Integer base, Integer exponent) {
  11.         this.base = base;
  12.         this.exponent = exponent;
  13.     }
  14.  
  15.     public Integer getBase() {
  16.         return base;
  17.     }
  18.  
  19.     public void setBase(Integer base) {
  20.         this.base = base;
  21.     }
  22.  
  23.     public Integer getExponent() {
  24.         return exponent;
  25.     }
  26.  
  27.     public void setExponent(Integer exponent) {
  28.         this.exponent = exponent;
  29.     }
  30.    
  31.     public void incrementExponent() {
  32.         this.exponent++;
  33.     }
  34.  
  35.     @Override
  36.     public String toString() {
  37.         return base + "^" + exponent;
  38.     }
  39.    
  40.    
  41.    
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement