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

The bishop of jerusalem was considered the pope, leader of the entire christian church. a. true b. false
What has to happen for a force to do work on an object?
Which properties cause chemical reactions? A. Neither chemical or physical properties B. Physical Properties C. Chemical Properties D. Chemical and Physical pro
1.91 rounded to the nearest tenth
57.281 in expanded form?
80 marked up by 37.5 percent
How long do Mosquitoes live?
Vas mucho a la biblioteca
write the slope-intercept form of the equation of the line passing through the point(-5,-2) and parallel to the line y=2x-2
What are two common pitfalls of bias??