son86000

CLASS_ALUNO_LIST<T>

Apr 24th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace RELATORIO_N_ALUNOS_POO
  7. {
  8.     class Aluno
  9.     {
  10.         //variáveis privadas
  11.         private string nome;
  12.         private double P1, P2;
  13.  
  14.         //construtor padrão
  15.         public Aluno(string nome, double P1, double P2)
  16.         {
  17.             this.nome = nome;
  18.             this.P1 = P1;
  19.             this.P2 = P2;
  20.         }
  21.  
  22.  
  23.         //método IsAprovado
  24.         public bool IsAprovado()
  25.         {
  26.             return getMedia() >= 6;
  27.         }
  28.  
  29.         public string getNome()
  30.         {
  31.             return nome;
  32.         }
  33.  
  34.         public double getMedia()
  35.         {
  36.             return (P1 + P2) / 2;
  37.         }
  38.     }
  39. }
Add Comment
Please, Sign In to add comment