Question: 2 0 . 5 . 2 : Complete the method that looks up a color name and returns the color code. 5 9 7 7

20.5.2: Complete the method that looks up a color name and returns the color code.
597714.2988516.qx3zqy7
You are given a map with color names and codes, such as:
{ "red" ->"#FF0000", "tomato" ->"#FF6347",...}
Complete the method below that, given any string and such a map, looks up the color code, or returns the original string if it is not a key of the map.

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!