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 are your beliefs and values as a teacher?
Mark is 5 years older than Juan, who is X year old. Write an expression for Mark's age.​
Use the quadratic formula to find the solutions to the quadratic equation below. 2x2 - 5x + 5 = 0
A car moves 6 miles North and turns around and travels 10 miles South. How far did the car travel? *
The annual precipitation amounts in a certain mountain range are normally distributed with a mean of 85 inches, and a standard deviation of 14 inches. What is t
Patterns in data can serve as _____________ to support a claim.
On what tectonic plate is the Hawaiian Hot Spot?
-3а- 8+2а = 13 How do you solve this (like terms)
Which of the following are appropriate names for the angle composed of the rays JK−→− and JL−→? Select the three correct answers. A. Angle JKL B. KJL C. L D. K
According to the curse pronounced by Noah (Genesis 9:24-27), ______ was to serve Shem and ______.