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

 

jebbert@volusia.k12.fl.us > nov4_2016_APSLHL_countLetter
prev  |  next  |  chance

Write a method that returns the number of times that the character 'ltr' appears in the string 'str'. Note that the string could be an empty string, or otherwise not contain any copies of 'ltr' in which case you would return a zero.


nov4_2016_APSLHL_countLetter("this is a test", "i") → 2
nov4_2016_APSLHL_countLetter("a whole lot of letter o can be found", "o") → 5
nov4_2016_APSLHL_countLetter("all good apes ate apples", "a") → 4

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

public int nov4_2016_APSLHL_countLetter(String str, char ltr) { }

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

Difficulty: 240

Copyright Nick Parlante 2017 - privacy