Introduction

In this course, students are at the beginning of their computer science careers. In four or so years, though, students will be graduating and looking for jobs on websites such as ZipRecruiter and Indeed. This application implements functionality that one would find on these job posting websites by processing information about programming jobs in the Knoxville area. The data the program will use for testing was taken and simplified and modified for this lab from multiple sources on real job postings in Knoxville, fall 2021.

Detailed Information

The application asks the user for an input file name. The contents of a sample input file with two jobs is shown below. One job consists of a line with the job description followed by a line with the number of job skills desired, n, followed by n lines each listing a skill, followed by a salary followed by a company name - all on separate lines. Assume all string data will have less than 256 characters, there will never be more than 10 job skills, and there will not be extra white space in the input file. Also, if there is a job title on one line, the following lines of data for that job are guaranteed to exist. Job titles, skills, and company names may all be comprised of more than one word (use getline).

UI Web Developer
8
Vue, Angular, or React
D3
Javascript
Java
Python
Node.js
Git
Relational database
83200
ITR
Front-End Developer
8
Agile
HTML5
CSS3
Javascript
Angular
NodeJS
AJAX
Git, Bitbucket, or Mercurial
0
CGI Group, Inc.

After getting the file name from the user, the program reads the data from the file into an array of structures using a structure definition such as the one below. The program must be able to process at most data on 10 jobs, but the input file may have more or less entries in it. If the input file has more than 10 jobs in it, the program only reads the first 10. If the input file has fewer than 10 jobs, the program partially fills the array of structures.

const int MAX_SKILLS = 10;
const int MAX_STRING_LENGTH = 256;
struct Job {
char jobTitle[MAX_STRING_LENGTH];
int numSkills;
char skills[MAX_SKILLS][ MAX_STRING_LENGTH];
double salary;
char company[MAX_STRING_LENGTH];
};

After reading the job data into the array of structures, print the following menu for the user:

1 Search for job by title
2 Search for a job by skill
3 Quit
Option>

If the user chooses option 1, the program searches for job by title by asking the user for a job title and printing a neatly formatted table of all jobs with that contain the word in the title (case-insensitive) in alphabetical order by job title as shown below. Words should be left aligned, numbers right aligned.

Job title: developer
Job Title Salary Company
-------------------------------------------------------------------------------
Front-End Developer $ 0 CGI Group, Inc.
Agile
HTML5
CSS3
Javascript
Angular
NodeJS
AJAX
Git, Bitbucket, or Mercurial
UI Web Developer $ 83200 ITR
Vue, Angular, or React
D3
Javascript
Java
Python
Node.js
Git
Relational database

If the user chooses option 2, the program searches for a job by skill by asking the user for the skill (case insensitive) and printing the job title, salary and company of all job postings that require that skill in a neatly formatted table as shown below in alphabetical order by job title. Words should be left aligned, numbers right aligned. Search for any skill that contains the search term.

Job skill: angular
Job Title Salary Company
-------------------------------------------------------------------------------
UI Web Developer $ 83200 ITR
Vue, Angular, or React
D3
Javascript
Java
Python
Node.js
Git
Relational database

A basic outline for your program is below. It is a good, high-level algorithm for the main function where most bullet points are functions themselves.

  • Print hello message
  • Read the data from the file and place it in the array of structures
  • Sort the array of structures by title
  • do
    • Print the user menu and get response
    • If response is 1, search by job title and print
    • Otherwise if response is 2, search by skill and print
    • Otherwise if not 1, 2 or 3 print invalid
  • while response not 3
  • Print goodbye message

Error checking:

  • If the input file doesn't exist, print the error message: Input file _____ does not exist. Please contact the administrator. (where ___ is the filename). End the program with a goodbye message.
  • If the input file exists but is empty, print the error message: Input file ____ is empty. Please contact the administrator. (where ___ is the filename). End the program with a goodbye message.

The easiest way to ask whether a C-string contains another C-string is to use the strstr function. This function is just another C-string function such as strcmp or strcpy. See https://cplusplus.com/reference/cstring/strstr/?kw=strstr for more information. If that's not enough for you to figure out how to use this function, then ask your instructor.

Use constants where appropriate. Write and use at least three functions other than main.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.