-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
45 lines (33 loc) · 979 Bytes
/
main.cpp
File metadata and controls
45 lines (33 loc) · 979 Bytes
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
#include <fstream>
#include <string>
#include "models/Job.h"
#include "models/Block.h"
#include "models/JobManager.h"
#include "models/MemoryManager.h"
using namespace std;
int main()
{
JobManager jobs;
ifstream dataFile("proj1_data.txt");
int process_id, memory_required, time_required;
if (dataFile.is_open()) {
while (dataFile >> process_id >> memory_required >> time_required)
jobs.add(process_id, memory_required, time_required);
}
dataFile.close();
char storage_method;
cout << "Which storage allocation method would you like to use? (B = best, F = first, W = worst, e = exit program): ";
cin >> storage_method;
string file_name;
if(storage_method == 'B') {
file_name = "hendrix_noah_best.txt";
}
if(storage_method == 'F') {
file_name = "hendrix_noah_first.txt";
}
if(storage_method == 'W') {
file_name = "hendrix_noah_worst.txt";
}
jobs.start(file_name, storage_method);
return 0;
}