Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Aluno
- {
- String _nome;
- String _cpf;
- String _end;
- double _coef;
- String _email;
- Curso _curso;
- Aluno(this._nome, this._cpf, this._end, this._coef, this._email, this._curso);
- String get nome
- {
- return _nome;
- }
- String get cpf
- {
- return _cpf;
- }
- String get end
- {
- return _end;
- }
- double get coef
- {
- return _coef;
- }
- String get email
- {
- return _email;
- }
- Curso get curso
- {
- return _curso;
- }
- set end(String end)
- {
- this._end = end;
- }
- set coef(double coef)
- {
- this._coef = coef;
- }
- set email(String email)
- {
- this._email = email;
- }
- }
- class Curso
- {
- String _nome;
- int _periodo;
- Curso(this._nome, this._periodo);
- String get nome
- {
- return _nome;
- }
- int get periodo
- {
- return _periodo;
- }
- set periodo(int periodo)
- {
- this._periodo = periodo;
- }
- }
- void main()
- {
- Curso curso01 = Curso("Programação 1", 2);
- Aluno aluno01 = Aluno("José da Silva", "123.456.789-98", "Rua x", 9.85, "jose@gmail.com", curso01);
- print("---------- ALUNO ----------");
- print("Nome: ${aluno01.nome}");
- print("CPF: ${aluno01.cpf}");
- print("Endereço: ${aluno01.end}");
- print("Coeficiente: ${aluno01.coef}");
- print("Email: ${aluno01.email}");
- print("Nome do Curso: ${aluno01.curso.nome}");
- print("Período do Curso: ${aluno01.curso.periodo}");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement