summaryrefslogtreecommitdiff
path: root/CPP/Basics/Ex2/CodeDemo.cpp
blob: 0afcd7a524dc1bed2c8d26048dfbfd794a1d30f9 (plain)
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
// Learning C++ 
// Challenge 04_05
// Calculate a GPA, by Eduardo Corpeño 

#include <iostream>
#include <vector>
#include "records.h"

using namespace std;

void init_students();

StudentRecords SR;
int id;

int main()
{
	init_students();

	cout << "Enter a student ID: ";
	cin >> id;

	SR.report_card(id);
	return 0;
}

void init_students()
{
	SR.add_student(1,"George P. Burdell");
	SR.add_student(2,"Nancy Rhodes");

	SR.add_course(1,"Algebra",5);
	SR.add_course(2,"Physics",4);
	SR.add_course(3,"English",3);
	SR.add_course(4,"Economics",4);

	SR.add_grade(1,1,'B');
	SR.add_grade(1,2,'A');
	SR.add_grade(1,3,'C');
	SR.add_grade(2,1,'A');
	SR.add_grade(2,2,'A');
	SR.add_grade(2,4,'B');
}