Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 tableStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started