Problem statement
IT South Pacific, a software company in Suva requires its annual budgetary
report on IT
staff salaries. This company’s 7 job titles and corresponding salaries are shown
below in
Table 1.1.
TABLE 1.1 Job Titles and corresponding Salaries
Job Title Yearly Salary
Trainee_Programmer 15000
Programmer 20000
Analyst_Programmer 25000
Senior_Analyst_Programmer 30000
Database_Administrator 30000
Assistant_Manager 35000
Manager 40000
According to company’s policy there cannot be more than 20 IT staff members at
one
time. Currently 12 IT positions are filled which can change when new staff
members are
recruited or old members have resigned. The details of current staff members are
shown
below in Table 1.2.
TABLE 1.2 Individual Staff Members and their Job Titles
Staff Job Title
John Trainee_Programmer
Sam Analyst_Programmer
Brown Programmer
White Programmer
Merry Trainee_Programmer
Tom Analyst_Programmer
Harry Programmer
Frank Trainee_Programmer
Joe Manager
Sony Assistant_Manager
Angela Trainee_Programmer
Karl Database_Administrator
Assume these positions will be filled throughout the year. Now produce the
summarized
report to get individual job titles and their corresponding total salaries in the
following
format:
(screen shot skipped)
Requirements
1. Write a program to store the table for Job Titles and corresponding Salaries
i.e.
data shown in Table 1.1.
2. Write a function void print_salary_table(?) to print the table stored in
question 1.
3. Write a search function int salary_index(string job_title) to
find the array index from the given job title. For example return 0 for
Trainee_Programmer, 1 for Programmer and so on.
4. Use the information given in Table 1.2 to determine the total amount of
salaries
for each job title. [Hint: Determine total individual job titles in order to determine
total salaries for individual job title]
5. Make a function print_annual_budget to print the table for job titles and
sum of salaries as shown in Fig 1.1.
6. Additional bonus marks will be given for using 2 dimensional arrays.
DO NOT VALIDATE ANY KEYBOARD ENTRY UNLESS OTHERWISE SPECIFIED
Use the following code to check for file error
Code:
if (input.fail()){
cerr<<"File not found!"<<endl;
system("PAUSE");
return 0;
}
Use if possible:
1. char *_itoa(int value, char *string, int radix)
Converts int to string
2. int atoi(const char *string)
Converts string to int
3. string str;
const char * cpt;
cpt = str.c_str();
Converts string to const char*
4. String formatting using <iomanip.h> header file
Study about <iomanip.h>, setiosflag(?) and setw(?) to represent the data nicely
in tabular
format