-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdriver.cpp
65 lines (57 loc) · 1.45 KB
/
driver.cpp
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
54
55
56
57
58
59
60
61
62
63
64
65
/* A scource file that
* driver.cpp
*
* Created on: 03 Mar 2018
* Author: Tumelo
*/
#include "database.h"
#include <cstdlib>
#include <iostream>
using namespace std;
int main(){
char input;
std::vector<student_record> students;
std::string name, surname, student_number, class_record, filename, temp;
do{
cout << "0: \t Add student" << endl;
cout << "1: \t Read database" << endl;
cout << "2: \t Save database" << endl;
cout << "3: \t Display given student data" << endl;
cout << "4: \t Grade Student" << endl;
cout << "q: \t Quit" << endl;
cout << "Enter a number (or q to quit) and press return..." << endl;
cin >> input;
switch(input){
case '0':
cout << "Enter name:" << endl;
cin >> name;
cout << "Enter surname:" << endl;
cin >> surname;
cout << "Enter student number:" << endl;
cin >> student_number;
cout << "Enter class record:" << endl;
cin >> temp;
std::getline(cin, class_record);
class_record = temp + class_record;
lphtum003::add_student(name, surname, student_number, class_record);
break;
case '1':
lphtum003::read_database(filename);
break;
case '2':
lphtum003::save_database(filename);
break;
case '3':
lphtum003::display_student(student_number);
break;
case '4':
lphtum003::grade_student(student_number);
break;
case 'q':
break;
default:
cout << "Invalid entry." << endl;
}
}while(input != 'q');
return 0;
}