Advertisement
KaiserRego

G5E1E2Nota

Oct 2nd, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. class G5E1E2Nota {
  2.    
  3.     private int Nota;
  4.    
  5.     public G5E1E2Nota (int valorInicial){
  6.        
  7.         if (valorInicial >= 0 && valorInicial <= 10){
  8.             Nota = valorInicial;
  9.         }
  10.         else{
  11.             Nota = 0;
  12.         }
  13.     }
  14.    
  15.     public int getValor(){
  16.        
  17.         return (Nota);
  18.     }
  19.    
  20.     public boolean aprobado(){
  21.        
  22.         return (Nota >= 4);
  23.     }
  24.    
  25.     public boolean desaprobado(){
  26.        
  27.         return (! aprobado());
  28.     }
  29.    
  30.     public void recuperar (int nuevoValor){
  31.        
  32.         if (nuevoValor> Nota && nuevoValor >= 0 && nuevoValor <= 10){
  33.             Nota= nuevoValor;
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement