immortalsoul7861
immortalsoul7861 immortalsoul7861
  • 06-04-2020
  • Computers and Technology
contestada

For this exercise, you are given a phrase. Return the number of time the word “dog” appears in the phrase.

Example:

countDog("dogs are good") --> 1
countDog("my dog does not like hot dogs") --> 2

This is in Java.

Respuesta :

rainestormee
rainestormee rainestormee
  • 19-04-2020

Answer:

Is in the provided screenshot!

Explanation:

Steps needed to solve this problem.

1) Split the input string into separate words

2) Filter the words to ones that match "dog"

3) Count how many words are left - as these are all the ones that say dog.

4) Return the value needed!

Ver imagen rainestormee
Answer Link

Otras preguntas

What food source contains all the essential amino acids and is the best source of protein? Beans Rice Meat Green leafy vegetables
which resources helped industry and farming develop in europe
I need help. What is a sudoku
Where in the plot pattern do we see the tension peak? Climax Exposition Conclusion Rising action
I'm which sphere would lightning be found in? A.atmosphere B.biosphere C.magnetosphere D.hydrosphere
Three points are collinear. always, sometimes, never
Some major concerns of physical science are
Active reading involves?
Most new jobs in the United States will be in the
Can someone help me with 11!!