Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

GIVEN CODE: #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

image text in transcribed

GIVEN CODE:

#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 Old Dominion University The output should be regular updates to the 2 files, as well as interactive menus display the file contents. Qbiectives: 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. Generallnstructions: Read the problem description below and reorganize this program in C++. The files for this Part A: assignment are provided under the folder for this assignment. You will be submitting two separate projects. See Part A and Part B for details. 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. - All of,the functions making up this program are complete and in working order except for Do this by looking for where the functions are being called and how the function is being used in the program. functions marked with " /// FILL THIS FUNCTION". You will need to implement these functions. Also, there may be other function that do similar, though not the same task. These functions may give you a - The major challenge in this assignment is to divide the program into separately compiled modules. clue how to implement the empty functions. - A candidates module with files 'sandidates h', and 'candidates.cpp', containing code The program should compile and have expected Input and Output as outlined above. You will not need to dealing specifically with manipulating the reservations array. split the functions into modules for part A. - A openings module, consisting of files 'gpepings hh' and 'openings.cpp' containing code dealing specifically with the opening position records. - An optional general functions module with the files 'generalfunctionsh' and Part B: 'generalFunctions.cpp'containing code that is not specifically geared towards candidates or openings. - Consult the comments in the provided code for additional details. Create a project containing the files 'main.cpp', 'candidates.cpp', 'candidates h', 'openings.cpp', 'QRepings. h', - There are some functions that are not specifically related to any of these modules, but 'generalFunctions.cpp', ggeneralfunctions h '. Split the functions from Part A into the appropriate modules as outlined in the general instructions. The program should compile and have the same input and output as Part are called by or contain code needed by certain modules You should apportion these A. In order to determine where a function belongs, look to see what functions it calls, and which functions it is functions to the modules in a way consistent with the goals of high cohesion. called by. Functions which rely heavily on each other are good candidates for a module. Functions which are Rroblem descriotion: associated in purpose may also be candidates for a particular module. 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 Submission notes: Candidate, Show Candidates, Show Candidates by Position, Filter Candidates By Rating, and Clear Screen. - Submit all files from your project folder, including the . 5Q0,cbDe.h, and input files. - Be sure that your project compiles on CS Department computers before submission. Input - Zip each folder and name it as "Assg2A_cslogin.zip" and "Assg2B_cslogin.zip", where the sslegin is your Input to the program is taken from several text files containing data regarding job openings and registered candidates. These are included, but your program should function even if the information in the data files were login ID for the computers at the Department of Computer Science at ODU. Bin and Debug folders do to change with the format being the same. The first line in every file is the number of data points (lines) in the not need to be included. file. - Submit the zipped file in the respective Blackboard link. Old Dominion University The output should be regular updates to the 2 files, as well as interactive menus display the file contents. Qbiectives: 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. Generallnstructions: Read the problem description below and reorganize this program in C++. The files for this Part A: assignment are provided under the folder for this assignment. You will be submitting two separate projects. See Part A and Part B for details. 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. - All of,the functions making up this program are complete and in working order except for Do this by looking for where the functions are being called and how the function is being used in the program. functions marked with " /// FILL THIS FUNCTION". You will need to implement these functions. Also, there may be other function that do similar, though not the same task. These functions may give you a - The major challenge in this assignment is to divide the program into separately compiled modules. clue how to implement the empty functions. - A candidates module with files 'sandidates h', and 'candidates.cpp', containing code The program should compile and have expected Input and Output as outlined above. You will not need to dealing specifically with manipulating the reservations array. split the functions into modules for part A. - A openings module, consisting of files 'gpepings hh' and 'openings.cpp' containing code dealing specifically with the opening position records. - An optional general functions module with the files 'generalfunctionsh' and Part B: 'generalFunctions.cpp'containing code that is not specifically geared towards candidates or openings. - Consult the comments in the provided code for additional details. Create a project containing the files 'main.cpp', 'candidates.cpp', 'candidates h', 'openings.cpp', 'QRepings. h', - There are some functions that are not specifically related to any of these modules, but 'generalFunctions.cpp', ggeneralfunctions h '. Split the functions from Part A into the appropriate modules as outlined in the general instructions. The program should compile and have the same input and output as Part are called by or contain code needed by certain modules You should apportion these A. In order to determine where a function belongs, look to see what functions it calls, and which functions it is functions to the modules in a way consistent with the goals of high cohesion. called by. Functions which rely heavily on each other are good candidates for a module. Functions which are Rroblem descriotion: associated in purpose may also be candidates for a particular module. 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 Submission notes: Candidate, Show Candidates, Show Candidates by Position, Filter Candidates By Rating, and Clear Screen. - Submit all files from your project folder, including the . 5Q0,cbDe.h, and input files. - Be sure that your project compiles on CS Department computers before submission. Input - Zip each folder and name it as "Assg2A_cslogin.zip" and "Assg2B_cslogin.zip", where the sslegin is your Input to the program is taken from several text files containing data regarding job openings and registered candidates. These are included, but your program should function even if the information in the data files were login ID for the computers at the Department of Computer Science at ODU. Bin and Debug folders do to change with the format being the same. The first line in every file is the number of data points (lines) in the not need to be included. file. - Submit the zipped file in the respective Blackboard link

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions