HandsOn 3
HandsOn 3
String Occurences
Obtain two strings from user as input. Your program should count the number
of occurences of second word of second sentence in the first sentence.
Return the count as output. Note - Consider case.
Include a class UserMainCode with a static method countNoOfWords which
accepts two string variables. The return type is the modified string.
Create a Class Main which would be used to accept two Input strings and
call the static method present in UserMainCode.
Input and Output Format:
Input consists of two strings with maximum size of 100 characters.
Output consists of a single string.
Refer sample output for formatting specifications.
Sample Input 1:
abc bcd abc bcd abc abc
av abc
Sample Output 1:
4
Sample Input 2:
ABC xyz AAA
w abc
Sample Output 2:
0
Create a Class Main which would be used to accept a string and call the
static method present in UserMainCode.
Input and Output Format:
Input consists of a string.
Output consists of a string (?Yes? or ?No?).
Refer sample output for formatting specifications.
Sample Input 1:
acbisouzze
Sample Output 1:
Yes
Sample Input 2:
cbisouzze
Sample Output 2:
No
3
4
5
6
Sample Output 1:
2
13
4
15
6
Create a Class Main which would be used to accept the input string and call
the static method present in UserMainCode.
Input and Output Format:
Input consists of a string with maximum size of 100 characters.
Output consists of a single string.
Refer sample output for formatting specifications.
Sample Input 1:
hi this is sample test
Sample Output 1:
hi tsample
Sample Input 2:
ABC DEF
Sample Output 2:
ABC DEF
Sample Input:
Rabbit
Sample Output:
t-i-b-b-a-R