Question: Using Java Q5 & Q6 (58 pts) Assume characters is a table of strings. It has 3 columns: Name, animal type and color, as in

Using Java

 Using Java Q5 & Q6 (58 pts) Assume characters is atable of strings. It has 3 columns: Name, animal type and color,

Q5 & Q6 (58 pts) Assume characters is a table of strings. It has 3 columns: Name, animal type and color, as in the sample data below. Write the following methods Pink brown white tabby white Peppa pig Danny dog Suzy sheep Candy cat Rebecca rabbit a) Write a method that takes the characters table and a color and returns the count of animals that have that color. For the above data and color "white" it will return 2 because two animals (Suzy and Rebecca) are white. b) Write a method that takes the characters table and a char and returns an arrayList of all the strings that have that character in them. The check should be case insensitive. For the above data and char 'd'it will return ["Danny", "dog", "Candy"]. If there is no string with that char, it should return an empty list (of size 0) c) Practice with all 4 possible representations of the characters table -2D array of strings, - ArrayList of ArrayLists of strings, ArrayList of arrays of strings array of ArrayLists of strings Note that only a small part of your code should change for each representation. d) Which of the above structures would you use, if you had to support the following modifications to the characters table: - add and/or remove rows from the table, - given an animal name such as "Candy" and a color such as "red", update that animal's color in the table. So "tabby" would be replaced with "red" in the table

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 Databases Questions!