Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please code these 2 functions in c++ based on what it says, you do not have to create a main or get a program to

Please code these 2 functions in c++ based on what it says, you do not have to create a main or get a program to run, but just coding these 2 functions.

Please use the record.dat as reference as to what would be there when coding the functions

----------------------------------------------------------

image text in transcribed

---------------------------------------------

Here are things that are in records.dat which is a txt file:

882966 Etzel 120580

189028 Goodwyn 74088

479122 Salzman 191052

484002 Ealey 57691

677207 Reich 155184

751833 River 40471

954117 Still 121316

791004 Gebhard 178656

115794 Mcphail 97020

690632 Dockery 140784

374049 Standard 82919

600003 Marker 186229

482416 Bachmann 117152

432128 Santillan 151831

625472 Dubuc 195442

751331 Demaria 91670

200523 Pollard 191803

983754 Gonsalves 114952

963867 Cull 104868

200772 Eoff 47022

680542 Bledsoe 194847

614227 Paradise 58515

860860 Fludd 136093

Employee class(if needed):

class Employee{ public: Employee(int, std::string, int); int id() const {return identifier;} std::string name() const {return lastname;} int sal() const {return salary;} void print(std::ostream &);

private: int identifier; std::string lastname; int salary; };

map> mapEmpDept (vector & emp); This function builds and returns an ordered map. The key for this map is the employee's department id. The department id is the first four most significant digits of the employee identifier. For example, a record in the records.dat file contains 882966 Etzel 120580" with 882966 as the employee id. The department this employee belongs to is 8829 map> mapsalRange (vectorEmployee> & emp); This function builds and returns an ordered map. The key for this map is related to the employee's salary based on 10,000 range increments. If the employee's salary is in the range of 40,000 to 49,999, the key is 40000. For example, a record in the records.dat file contains 882966 Etzel 120580" with 120580 as the employee's salary. The salary range for this employee is 120000. Thus, the range is in 10,000 increments. Range 0 takes values [0,10000) and the key for this is 0, range 10,000 takes values from [10000, 20000) and the key for this is 10000 map> mapEmpDept (vector & emp); This function builds and returns an ordered map. The key for this map is the employee's department id. The department id is the first four most significant digits of the employee identifier. For example, a record in the records.dat file contains 882966 Etzel 120580" with 882966 as the employee id. The department this employee belongs to is 8829 map> mapsalRange (vectorEmployee> & emp); This function builds and returns an ordered map. The key for this map is related to the employee's salary based on 10,000 range increments. If the employee's salary is in the range of 40,000 to 49,999, the key is 40000. For example, a record in the records.dat file contains 882966 Etzel 120580" with 120580 as the employee's salary. The salary range for this employee is 120000. Thus, the range is in 10,000 increments. Range 0 takes values [0,10000) and the key for this is 0, range 10,000 takes values from [10000, 20000) and the key for this is 10000

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

What is meant by Career Planning and development ?

Answered: 1 week ago

Question

What are Fringe Benefits ? List out some.

Answered: 1 week ago

Question

=+j Explain the litigation risks in international labor relations.

Answered: 1 week ago

Question

=+j What rules will apply to the process of negotiations?

Answered: 1 week ago