daily pastebin goal
79%
SHARE
TWEET

Alumno

alduncin Nov 14th, 2011 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Alumno
  2. {
  3.     private int cal1, cal2, cal3, suma;
  4.     private double promedio;
  5.  
  6.     public Alumno()
  7.     {
  8.          cal1 = 0;
  9.          cal2 = 70;
  10.          cal3 = 0;
  11.     }
  12.  
  13.     public Alumno(int cal1, int cal2)
  14.     {
  15.          this.cal1 = cal1;
  16.          this.cal2 = cal2;
  17.          cal3 = 0;
  18.     }
  19.    
  20.     public void calcularPromedio()
  21.     {
  22.         suma = cal1 + cal2 + cal3;
  23.         promedio = suma/3;
  24.     }
  25.  
  26.     public void setCal1(int cal)
  27.     {
  28.         cal1 = cal;
  29.     }
  30.  
  31.     public void setCal2(int cal)
  32.     {
  33.         cal2 = cal;
  34.     }
  35.  
  36.     public void setCal3(int cal)
  37.     {
  38.         cal3 = cal;
  39.     }
  40.  
  41.     public void setCalificaciones(int cal1, int cal2, int cal3)
  42.     {
  43.         this.cal1 = cal1;
  44.         this.cal2 = cal2;
  45.         this.cal3 = cal3;
  46.     }
  47.  
  48.     public double getPromedio()
  49.     {
  50.         return promedio * 2;
  51.     }
  52.  
  53.     public int getCal1()
  54.     {
  55.         return cal1;
  56.     }
  57.     public int getCal2()
  58.     {
  59.         return cal2;
  60.     }
  61.     public int getCal3()
  62.     {
  63.         return cal3;
  64.     }
  65.  
  66.  
  67. }
  68.  
RAW Paste Data
Top