Advertisement
joaopaulofcc

Untitled

Jul 26th, 2020
1,205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.48 KB | None | 0 0
  1. class Aluno
  2. {
  3.   String _nome;
  4.   String _cpf;
  5.   String _end;
  6.   double _coef;
  7.   String _email;
  8.   Curso _curso;
  9.  
  10.   Aluno(this._nome, this._cpf, this._end, this._coef, this._email, this._curso);
  11.  
  12.   String get nome
  13.   {
  14.     return _nome;
  15.   }
  16.  
  17.   String get cpf
  18.   {
  19.     return _cpf;
  20.   }
  21.  
  22.   String get end
  23.   {
  24.     return _end;
  25.   }
  26.  
  27.   double get coef
  28.   {
  29.     return _coef;
  30.   }
  31.  
  32.   String get email
  33.   {
  34.     return _email;
  35.   }
  36.  
  37.   Curso get curso
  38.   {
  39.     return _curso;
  40.   }
  41.  
  42.   set end(String end)
  43.   {    
  44.     this._end = end;
  45.   }
  46.  
  47.   set coef(double coef)
  48.   {    
  49.     this._coef = coef;
  50.   }
  51.  
  52.   set email(String email)
  53.   {    
  54.     this._email = email;
  55.   }
  56. }
  57.  
  58. class Curso
  59. {
  60.   String _nome;
  61.   int _periodo;
  62.  
  63.   Curso(this._nome, this._periodo);
  64.  
  65.   String get nome
  66.   {
  67.     return _nome;
  68.   }
  69.  
  70.   int get periodo
  71.   {
  72.     return _periodo;
  73.   }
  74.  
  75.   set periodo(int periodo)
  76.   {    
  77.     this._periodo = periodo;
  78.   }
  79. }
  80.  
  81.  
  82. void main()
  83. {
  84.  
  85.   Curso curso01 = Curso("Programação 1", 2);
  86.   Aluno aluno01 = Aluno("José da Silva", "123.456.789-98", "Rua x", 9.85, "jose@gmail.com", curso01);
  87.  
  88.   print("---------- ALUNO ----------");
  89.   print("Nome: ${aluno01.nome}");
  90.   print("CPF: ${aluno01.cpf}");
  91.   print("Endereço: ${aluno01.end}");
  92.   print("Coeficiente: ${aluno01.coef}");
  93.   print("Email: ${aluno01.email}");
  94.   print("Nome do Curso: ${aluno01.curso.nome}");
  95.   print("Período do Curso: ${aluno01.curso.periodo}");
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement