-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDeveloper.cpp
95 lines (84 loc) · 2.04 KB
/
Developer.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include<iostream>
#include<string>
using namespace std;
/*struct job
{
string jobTitle;
int noOfVacancies;
};
struct Company
{
string comName; // key
struct job* jobArray;
};
void addCompany(string Name, int noOfJobs) {
struct Company* company = new struct Company;
company->comName = Name;
company->jobArray = new struct job[noOfJobs];
insertjob(company->jobArray,noOfJobs);
}
void insertjob(struct job* array,int N)
{
for (int i = 0; i < N; i++) {
cout << "Enter the job title:";
cin>>array[i].jobTitle;
cout << endl;
cout << "Enter the number of Vaccancies:";
cin >> array[i].noOfVacancies;
}
}
void insertJob(struct job* array, int n)
{
for (int i = 0; i < n; i++) {
displayJobDetails();
cout << "Enter the job title:";
cin >> array[i].jobTitle;
cout << endl;
cout << "Enter the Job Reference Number: ";
cin >> array[i].refNumber;
cout << endl;
cout << "Enter the number of Vaccancies: ";
cin >> array[i].noOfVacancies;
cout << endl;
}
}*/
/*void writeToJob(string fileName) {
fstream file;
file.open(fileName, ios::app);
for (int i = 0; i < N; i++) {
if (HashArray[i] != NULL) {
for (int j = 0; j < HashArray[i]->noOfJobs; j++) {
file << (HashArray[i]->jobArray[j]).refNumber <<" " << (HashArray[i]->jobArray[j]).jobTitle <<" " << (HashArray[i]->jobArray[j]).noOfVacancies<<",";
}
file << endl;
}
}
file.close();
}
void readCompany(string Name) {
struct Company* company = new struct Company;
company->comName = Name;
company->noOfJobs = noOfJobs;
//readJobs(company->jobArray, noOfJobs);
int index = hashFunction(Name);
while (HashArray[index] != NULL) { //linear probing algorithm
index++;
index = index % N;
}
HashArray[index] = company;
}
string comName;
int noOfJobs;
for (int i = 0; i < 1; i++) {
cout << "Enter The Company Name :";
cin >> comName;
cout << endl;
cout << "Enter the no of jobs : ";
cin >> noOfJobs;
//addCompany(comName, noOfJobs);
}
//sortJobs();
//displayDetails();
//displaysortArray();
writeToCompany("Company.csv");
writeToJob("CompanyJob.csv");*/