Question: Fill in the values WWW, XXX, YYY and ZZZ to make a method that takes a double value named pct, a Set that contains employee

Fill in the values WWW, XXX, YYY and ZZZ to make a method that takes a double value named pct, a Set that contains employee ids and a Map that has employee ids and salaries as its key/value pairs. The method should give every employee in the Set an increase in salary equal to the percentage passed in as pct (for example, if pct is 0.10 then each employee gets a 10% raise).

For example if the set contains {2, 3} and the map contains { (1, 34000.0), (2, 32000.0), (3, 30000.0) } and pct is 0.1 then after the call the map will contain { (1, 34000.0), (2, 35200.0), (3, 33000.0) }

public static void giveRaise(WWW, double pct) { for ( XXX ) { double salary = YYY; salary = salary + salary*pct; ZZZ; } }

WWW= [ Select ] ["Map salaries, Set ids", "Map ids, Set salaries", "Map ids, Set salaries", "Map salaries, Set ids"]

XXX = [ Select ] ["int key: ids.keySet()", "int key : salaries.keySet()", "int key : salaries", "int key : ids"]

YYY = [ Select ] ["ids.remove(key)", "salaries.get(key)", "salaries.remove(salary)", "ids.put(key)"]

ZZZ [ Select ] ["salaries.put(salary,key)", "ids.put(key,salary)", "ids.put(salary,key)", "salaries.put(key,salary)"]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!