-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIT_Final.cpp
57 lines (47 loc) · 2.05 KB
/
IT_Final.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
#include "stdafx.h"
#include <iostream>
#include <stdlib.h>
#include <string>
#include "getInput.h"
#include "fileHandler.h"
#include "checkData.h"
int main()
{
//Start of the program
std::cout << "Main Console\n--------------------\n1. Add to database\n2. Start Program\n3. View Database\n4. Exit\n--------------------" << std::endl;
std::string menuPicker;
getInput newInput;
checkData viewDB;
//Menu: Loop the certain under these conditions(While user input is not 3(exit))
do
{
std::cout << ">";
std::cin >> menuPicker;
if (menuPicker == "1")
{
system("cls");
break;
}
if (menuPicker == "2")
{
//Clears screen and starts getInput class
newInput.getStudentId();
break;
}
if (menuPicker == "3")
{
viewDB.viewDatavbase();
break;
}
else
{
std::cout << "Please enter a valid menu number" << std::endl;
}
} while (menuPicker != "4");
fileHandler handle;
if (menuPicker == "1")
{
handle.writeToFile();
}
return 0;
}