Fill in the values WWW, XXX, YYY and ZZZ to make a method that takes a double
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 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
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)"]
Financial Accounting for Decision Makers
ISBN: 978-0273763451
6th Edition
Authors: Peter Atrill, Eddie McLaney