Following employee-to-role-to-rate lookups

A repair company calculates labour charges using three maps. Employee identifiers are exact string keys, and every lookup needed below succeeds.


Employee key

Value in role map

Value in hours map (h)

E19

Senior

4

E07

Trainee

5

E42

Senior

3

E30

Specialist

2


Role key

Value in rate map (USD/h)

Specialist

52

Trainee

24

Senior

38


For each employee, the program looks up the employee's role, uses that role as a key in the rate map, and multiplies the resulting rate by the employee's recorded hours. The total labour charge is the sum across all four employees. Ignore taxes and additional fees.


Find both quantities below in USD, to two decimal places:

  • The initial total labour charge.
  • The revised total labour charge after role.put(E07, Senior) and then rate.put(Senior, 41).

The company recomputes the revised charge for the same recorded hours using the updated maps. No previously calculated charges are retained.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Map ADT Questions: