Question: In Java, please! String peopleNames is read from input. peopleNames contains people names separated by dots ( ' . ' ) . Count the number
In Java, please!
String peopleNames is read from input. peopleNames contains people names separated by dots Count the number of dots in peopleNames.
Ex: If the input is Mia.Cam.Bob.Gil, then the output is:
Dot found at index
Dot found at index
Dot found at index
Dot occurs times
import java.util.Scanner;
public class FindDots
public static void mainString args
Scanner scnr new ScannerSystemin;
String peopleNames;
int i;
int numOccurrences ;
peopleNames scnrnextLine;
enter your code here
System.out.printlnDot occurs numOccurrences times";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
