ICSE
plzz solve ...dont provide any suggestions plzz solve full...
Attachments:

Answers
Answered by
0
have got 95.2% in my ICSE board exams so I guess I am qualified enough to answer the question. As the board exams are approaching I will tell you that what you should do subject wise to get your aim which you say that is 90% above.
anshi7581:
hey boards are going to end u plzz answer this que
Answered by
1
import java.io.*;
public class string2 { public static void main(String args[])throws IOException { InputStreamReader read = new InputStreamReader(System.in); BufferedReader in = new BufferedReader(read);
String word="";
int sp=0; int c=0;
System.out.println("Enter your String");
String sentence = in.readLine(); sentence=sentence+" ";
int len=sentence.length(); System.out.println("Enter the word whose frequency is to be found");
String search = in.readLine();
for(int i=0;i<len;i++)
{ char ch=sentence.charAt(i);
if (ch==' ')
{ word = sentence.substring(sp,i);
sp=i+1; if(word.equalsIgnoreCase(search)==true)
{ c++; }
}
} System.out.println("The number of substring "+search+" in the string is "+c);
}
}
Hope it helps u buddy....
cheers up☺
public class string2 { public static void main(String args[])throws IOException { InputStreamReader read = new InputStreamReader(System.in); BufferedReader in = new BufferedReader(read);
String word="";
int sp=0; int c=0;
System.out.println("Enter your String");
String sentence = in.readLine(); sentence=sentence+" ";
int len=sentence.length(); System.out.println("Enter the word whose frequency is to be found");
String search = in.readLine();
for(int i=0;i<len;i++)
{ char ch=sentence.charAt(i);
if (ch==' ')
{ word = sentence.substring(sp,i);
sp=i+1; if(word.equalsIgnoreCase(search)==true)
{ c++; }
}
} System.out.println("The number of substring "+search+" in the string is "+c);
}
}
Hope it helps u buddy....
cheers up☺
Similar questions