Question
I need urgent assistance in filling in blanks and descriptions for this programming problem. I put screenshots of the header files needed at the bottom.
I need urgent assistance in filling in blanks and descriptions for this programming problem. I put screenshots of the header files needed at the bottom. I just need help in filling in the code. Any help would be greatly appreciated. Thank you.
#include
#include
#include
#include "job.h"
#include "list.h"
using namespace std;
// MAX variable is for limiting the number of lines of data that can be read in:
int const MAX = 24;
// Function declarations:
void readJobInfo(ListClass & jobList, int & count, ifstream & InputStream);
void mainMenu(const ListClass & jobList, int count);
int main()
{
//Declare all the necessary variables and the array of objects
ifstream InFile;
string junk;
string dataFileName;
int count = 0;
ListClass jobListMain;
//*** Prompt name of the datafile to open and read in that name.
// ---------
//*** Open for reading the data file by that name.
// --------
//*** If open failed, print an error message and exit the program.
//---------
//*** Call readJobInfo function with appropriate parameters.
//----------
//*** Close file that was opened here in main.
//----------
//*** Call the mainMenu function.
//-----------
return 0;
}
/* Given:InputStream *** describe what this is --------***
Task: *** describe what this function does ---------- ***
Return: jobList *** describe what data it now contains ----------***
count *** describe what this now contains ----------***
*/
void readJobInfo(ListClass & jobList, int & count, ifstream & InputStream)
{
// declares all the vars needed in the function
count = 0;
string tempCompName;
string tempJob;
int tempSalary;
string junk;
string tempState;
string tempPhone;
string tempEmail;
string tempWeb;
int tempDesirability = 0;
JobOpening tempOpening;
// Read the data for the first job opening ahead of the loop:
getline(InputStream, tempCompName, ',');
getline(InputStream, tempJob, ',');
InputStream >> tempSalary;
getline(InputStream, junk, ',');
getline(InputStream, tempState, ',');
getline(InputStream, tempPhone, ',');
getline(InputStream, tempEmail, ',');
getline(InputStream, tempWeb, ' ');
while (!(InputStream.fail()) && (count
{
// Use the temporary JobOpening object tempOpening to store all the data for the currrent job opening:
tempOpening.SetCompanyName(tempCompName);
tempOpening.SetJobTitle(tempJob);
tempOpening.SetSalary(tempSalary);
tempOpening.SetLocation(tempState);
tempOpening.SetPhone(tempPhone);
tempOpening.SetEmail(tempEmail);
tempOpening.SetWebsite(tempWeb);
// Print out all the fields of the job for the user to see:
cout
cout
cin >> tempDesirability;
// *** Fill in the code to place the desirability number into the correct field of the tempOpening job object ***
//---------
// *** Fill in the code to put the newly created object tempOpening into a new node at the front of jobList:
//---------
count++;
// Read in the data for another job opening and repeat:
getline(InputStream, tempCompName, ',');
getline(InputStream, tempJob, ',');
InputStream >> tempSalary;
getline(InputStream, junk, ',');
getline(InputStream, tempState, ',');
getline(InputStream, tempPhone, ',');
getline(InputStream, tempEmail, ',');
getline(InputStream, tempWeb, ' ');
}
getline(cin, junk, ' '); // Clear the input buffer after the last desirability number has been read.
if (!(InputStream.fail()))
{
cout
cout
cin.get();
}
}
/* Given:jobList *** Describe what data is coming into this function in jobList ----------***
count *** Describe what this parameter is bringing into this function ----------***
Task: This function repeatedly prints out a menu with the options for the user to pick from.
The user is able to pick from 3 choices: Printing all the job openings, searching for jobs
based on a range of salary and desirability, and to exit the program. Calls the proper functions to
carry out the users choice. Presents the user the menu after each choice until they decide
to exit the program
Return: Nothing.
*/
void mainMenu(const ListClass & jobList, int count)
{
int choice, salaryMax, salaryMin, desirabilityMax, desirabilityMin;
string junk;
cout
cout
cout
cout
cin >> choice;
getline(cin, junk, ' '); // Clear out the input line after reading the number.
while (choice != 3)
{
if (choice == 1)
//*** Call the Print function on the jobList object.
//-----------
;
else if (choice == 2)
{
//*** Prompt for and read in the min and max salary desired as well as the min and max desirability numbers.
//--------
getline(cin, junk, ' '); // Clear out the input line after reading the number.
//*** Call the Search function on the jobList object and pass to it as parameters the 4 values just read in.
//---------
}
else
cout
cout
cout
cout
cout
cin >> choice;
getline(cin, junk, ' '); // Clear out the input line after reading the number.
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started