Problem

Which Collection Classes?For each scenario, describe which Collection class(es) you would...

Which Collection Classes?

For each scenario, describe which Collection class(es) you would use, how you would use the class(es), and why you choose the class(es).

a. You want to maintain a list of foods together with the number of calories in each food. Your list should allow a user to specify a food and retrieve the number of calories for that food. You should be able to add new foods to the list.


b. You want to maintain a list of your daily meals—foods and calories. You should be able to specify a particular day and retrieve the day’s meals. You should be able to retrieve the total number of calories for any consecutive number of days.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 17
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT