forked from ClaudomiroSales/GradeBook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (38 loc) · 1.38 KB
/
main.cpp
File metadata and controls
53 lines (38 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "GradeBook.cpp"
#include "GradeBook.h"
#include <vector>
using std::vector;
//This is where the execution of program begins
int main()
{
//Apenas 4 turmas podem ser criadas
//GradeBook.cpp: const int GradeBook::NUMTURMAS = 4;
GradeBook gradebook1( "Math", 3 );
GradeBook *gradebookPtr;
int novosAlunos = 5;
//Criando uma lista de alunos
vector< string * > alunos;
alunos.push_back( new string( "Noemi") );
alunos.push_back( new string( "Sopia") );
alunos.push_back( new string( "Catarina") );
alunos.push_back( new string( "Raphael") );
alunos.push_back( new string( "Ursula") );
alunos.push_back( new string( "Natasha") );
gradebookPtr = new GradeBook( "Geografia", 3 );
gradebookPtr->displayMessage( );
gradebookPtr->setNumAlunos( novosAlunos );
gradebookPtr->displayMessage( );
//Cadastrando os alunos da lista no gradebook de Geografia
for( int i = 0; i < alunos.size(); i++ )
gradebookPtr->cadastrarAlunoGradeBook( *alunos[ i ] );
gradebookPtr->displayMessage( );
GradeBook *gradebookPtr_extra = new GradeBook( *gradebookPtr );
cout << "\n\nImprimindo informacoes de gradebookPtr_extra.\n";
gradebookPtr_extra->displayMessage( );
//Desalocando memória
for( int i = 0; i < alunos.size(); i++ )
delete alunos[ i ];
delete gradebookPtr;
delete gradebookPtr_extra;
return 0;
}