Liskov's exercises | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Liskov's exercises

Specify a map class, named StringIntMap, which maps strings to integers. Maps allow an existing mapping to be looked up. Maps are also mutable: new pairs can be added to a map, and an existing mapping can be removed. Be sure that your data type is adequate. I have a exercises like that but i don't know what it want to tell me, i don't know what i must to do. Can somebody explain it for me? plsssss Thank you so much

25th Apr 2019, 7:56 AM
Ha Nguyen
Ha Nguyen - avatar
3 Answers
+ 3
I think the exercise telling you to: 1. Create a custom class named StringIntMap. 2. The class serves as a collection of key-value pairs, where string is the key, and integer is the value. 3. Add a search method to seek for an item in the collection class, using a string input as the search term. 4. Add methods to add and remove item(s) from the collection. That's how I see it, hope it helps a bit; and good luck with the exercise implementation 👍
25th Apr 2019, 8:47 AM
Ipang
+ 2
You're welcome Ha Nguyen , I'm glad if it helps, best of luck with the exercise 👍
25th Apr 2019, 8:58 AM
Ipang
+ 1
Ipang thank you it help me so much
25th Apr 2019, 8:55 AM
Ha Nguyen
Ha Nguyen - avatar