id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

konstans@stuy.edu apcs1 > catty3
prev  |  next  |  chance

Given an ArrayList of animals, some of which that have a substring "cat" or "Cat" in them: Modify the ArrayList by adding a normal "cat" before every non-cat animal. Return animalsList when done.


catty3([]) → []
catty3(["buffalo", "dog", "bat"]) → ["cat", "buffalo", "cat", "dog", "cat", "bat"]
catty3(["bobcat", "siamese cat", "catbird"]) → ["bobcat", "siamese cat", "catbird"]

...Save, Compile, Run (ctrl-enter)

public List<String> catty3(List<String> animalsList) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy