Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

}

}

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
#pragmaonce #include "listnode.h" class ListClass { private: ListNodePtr GetNode (const ItemType & Item, ListNodePtr NextPtr = NULL) ; void FreeNode (ListNodePtr NodePtr) ; void ClearList (void) ; / / Next 3 are sometimes made into protected fields: ListNodePtr Front, Rear; int Count; public: // constructor: ListClass (void) ; // destructor: ~ListClass (void) ; int NumItems (void) const; bool Empty (void) const; void InsertFront (const ItemType & Item) ; void InsertRear (const ItemType & Item) ; void Print( ) const; / /*** Added const since printing an object should not change it. ItemType RemoveFront (void) ; void Search(int salaryMin, int salaryMax, int desirabilityMin, int desirabilityMax) const; / /*** Added const since printing an object should not change it. };/* Filename: ItemType. h 2 This header file is used to define ItemType. Modify this file to define the kind of data you wish to place in your linked list. If the data type does not have == and > operators, you will need to provide 6 overloaded ones, perhaps by using a class for this data type. 7 * / 9 / / The following keeps ItemType.h from being included more than once: 10 #pragmaonce 11 12 #include 13 #include "job.h" 14 using namespace std; 15 typedef JobOpening ItemType; 163 #pragmatonce #include #include using namespace std; 9 class JobOpening 10 11 private: 12 // The 8 private fields of data about a job opening: 13 string CompanyName ; 14 string JobTitle; 15 string Location; 16 string Phone; 17 string Email; 18 string Website; 19 int Salary; 20 int Desirability; 21 22 public : 23 // Default constructor: 24 JobOpening (string CompanyNameValue = "", string JobTitleValue = "", 25 string LocationValue = "", string PhoneValue = "", string EmailValue = "", 26 string WebsiteValue = "", int SalaryValue = 0, int DesirabilityValue = 0) ; 27 28 // The 8 set functions: 29 void SetCompanyName (string CompanyNameValue) ; 30 void SetJobTitle(string JobTitleValue) ; 31 void SetLocation (string LocationValue) ; 32 void SetPhone (string PhoneValue) ; 33 void SetEmail(string EmailValue) ; 34 void SetWebsite(string WebsiteValue) ; 35 void SetSalary (int SalaryValue) ; 36 void SetDesirability (int DesirabilityValue) ;| 37 / / The 8 get functions: 38 string GetCompanyName (void) const; 39 string GetJobTitle (void) const; 40 string GetLocation (void) const; 41 string GetPhone (void) const; 42 string GetEmail(void) const; 43 string GetWebsite (void) const; 44 int GetSalary (void) const; 45 int GetDesirability (void) const; 46* Filename: listnode. h On A W N This is the header file to accompany listnode. cpp. These 2 files provide ListNodeClass as shown below. Also provided is the ListNodePtr type. 6 * / 8 #pragmat once 9 #include "itemtype.h" 10 11 class ListNodeClass 12 { 13 private: 14 ItemType Info; 15 ListNodeClass* Next; 16 public : 17 / / First, the constructor: 18 ListNodeClass (const ItemType& Item, ListNodeClass* NextPtr = NULL) : 19 Info (Item) , Next (NextPtr) 20 21 22 void GetInfo ( ItemType& TheInfo) const; 23 friend class ListClass; // very convenient to allow this 24 }; 25 26 typedef ListNodeClass* ListNodePtr; 27

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions