Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE FILL OUT FUNCTIONS: void LoadCandidates void AddOpening void swapItems void FindMatches ***This is the code I was given*** #include #include #include #include #include //

image text in transcribedimage text in transcribed

PLEASE FILL OUT FUNCTIONS:

void LoadCandidates

void AddOpening

void swapItems

void FindMatches

***This is the code I was given***

#include #include #include #include #include // for string streams #include using namespace std; void Menu(); string IntToString(int i); int StringToInt(string s); void AddOpening(string openings[][7], int size); void PrintOpenings(string openings[][7], int size); void LoadOpenings(ifstream& infile, string openings[][7], int num_openings); void DeleteOpening(string openings[][7], int size); void GetOpening(string opening[7]); void SaveOpenings(string openings[][7], int size); void ResetIDs(string openings[][7], int size); void swapItems(string openings[][7], int indexA, int indexB); void FindMatches(string candidates[][6], int cand_size, string openings[][7], int opening_size); void GetCandidate(string candidate[6]); void SaveCandidates(string temp[][6], int size); void LoadCandidates(ifstream& infile, string candidates[][6], int num_candidates); void AddCandidate(string candidates[][6], int size); void ShowCandidatesByPosition(string candidates[][6], int size); void PrintCandidates(string candidates[][6], int size); void SwapCandidates(string candidates[][6], int indexA, int indexB); void SortByRating(string candidates[][6], int num_candidates); void FilterCandidatesByRating(string candidates[][6], int num_candidates); void PrintCandidate(string temp[][6], int index); int main() { Menu(); return 0; } //loads the contents of the candidates array in a 2D string array called candidates /um candidates is the number of entries in the files, must be provided as a parameter //meaning that the file is opened at least ones before callign this function void LoadCandidates(ifstream& infile, string candidates[][6], int num_candidates) { ///FILL THIS FUNCION } void AddCandidate(string candidates[][6], int size) { string newCandidate[6]; GetCandidate(newCandidate); string temp[size+1][6]; for(int i=0; i

{ temp[size][i]=newCandidate[i]; } size++; SaveCandidates(temp, size); //save to file } void GetCandidate(string candidate[6]) { string temp; cout>temp; candidate[0]=temp; cout>temp; candidate[1]=temp; cout>temp; candidate[2]=temp; cout>temp; candidate[3]=temp; cout>temp; candidate[4]=temp; cout>temp; candidate[5]=temp; } void SaveCandidates(string temp[][6], int size) { ofstream outfile; outfile.open("candidates.txt", ios::out); outfile

cout>position; if(cin.fail()==true) { system("CLS"); cout candidates[j+1][4]) SwapCandidates(candidates, j, j+1); PrintCandidates(candidates, num_candidates); } void FilterCandidatesByRating(string candidates[][6], int num_candidates) { int rating; GetRating: cout>rating; if(cin.fail() == true || rating 5) { system("CLS"); cout

int counter=0; string temp; for(int i=0; i= rating) counter++; } string f_cand[counter][6]; int copied=0; while(copied= rating) { for(int k=0; k>openings[i][j]; } } void PrintOpenings(string openings[][7], int size) {

cout>del_id; if(cin.fail()==true || del_id (size-1)) { system("CLS"); cout

void GetOpening(string opening[7]) { string temp; //we keep re-assining values to this temp variable cout>temp; opening[1]=temp; //store temp value to its place in the array cout>temp; opening[2]=temp; cout>temp; opening[3]=temp; cout>temp; opening[4]=temp; cout>temp; opening[5]=temp; cout>temp; opening[6]=temp; } void SaveOpenings(string openings[][7], int size) { ofstream outfile; outfile.open("openings.txt", ios::out); //opens the file for writing purposes outfile

stringstream temp(s); int integer = 0; temp >> integer; return integer; } //this converts integers to strings string IntToString(int i) { ostringstream str1; str1>num_openings; //read # of entries in file inCandidates.open("candidates.txt", ios::in); inCandidates>>num_candidates; string openings[num_openings][7]; //create array to store info currently in file string candidates[num_candidates][6]; LoadOpenings(inOpenings, openings, num_openings); //this loads the contents to the array, so that we can use it in subsequent operations LoadCandidates(inCandidates, candidates, num_candidates); inOpenings.close(); //close the files inCandidates.close(); GetSelection: //This is a label, a destination for a goto statement. Allows us to reenter the menu without writing a while loop cout

cout>input; if(cin.fail() == true || input>9) { system("CLS"); cout

}

Obiectives: This assignment will give you an opportunity to explore the process of dividing a C++ program into modules and using the project support components of a C++ IDE to manage your modules. General Instructions: Read the problem description below and reorganize this program in C++. The files for this assignment are provided under the folder for this assignment. You will be submitting two separate projects. See Part A and Part B for details. - All of the functions making up this program are complete and in working order except for functions marked with "/// FILL THIS FUNCTION". You will need to implement these functions. - The major challenge in this assignment is to divide the program into separately compiled modules. - A candidates module with files 'candidates.h' and 'candidates.cpp', containing code dealing specifically with manipulating the reservations array. - A openings module, consisting of files 'openings.h' and 'openings.cpp' containing code dealing specifically with the opening position records. - An optional general functions module with the files 'generalfunctions.h' and 'generalFunctions.cpp'containing code that is not specifically geared towards candidates or openings. - Consult the comments in the provided code for additional details. - There are some functions that are not specifically related to any of these modules, but are called by or contain code needed by certain modules You should apportion these functions to the modules in a way consistent with the goals of high cohesion. Problem description: A new startup company has been left without a database after a falling out with the previous database administrator. As an intern, you have decided to impress management by creating a program that uses some of those files to aid company recruiters in managing openings and potential candidates. The program must have the following options: Add Opening, Delete Opening, Show Openings, Match Candidates with all Openings, Add Candidate, Show Candidates, Show Candidates by Position, Filter Candidates By Rating, and Clear Screen. Create a project containing the file 'main.cpp'. Implement the empty functions marked with "///Fill This Function" comments. You will need understand the purpose of these function in order to implement them. Do this by looking for where the functions are being called and how the function is being used in the program. Also, there may be other function that do similar, though not the same task. These functions may give you a clue how to implement the empty functions. The program should compile and have expected Input and Output as outlined above. You will not need to split the functions into modules for part A

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions