Class XII String Programs (Part 2)
Class XII String Programs (Part 2)
1. A class Data has been defined to perform string operations. Some of the
members of the class are given below:
Member functions/methods:
Specify the class Data, giving the details of the constructor( ), void accept( )
and void computePrint( ). Define the main( ) function to create an object and
Member functions/methods:
parameterized string w
function to create an object and call the functions accordingly to enable the
task.
import java.util.*;
class WordWise
String str;
WordWise()
{
str = "";
}
void readsent()
str=sc.nextLine();
int freq_vowel(String w)
int c = 0;
w = w.toUpperCase();
char ch = w.charAt(i);
c++;
}
return c;
}
void arrange()
String w = "";
char ch = str.charAt(i);
w = w + ch;
else
int v = freq_vowel(w);
System.out.println(w+"\t"+v);
w = "";
}
}
}
public static void main(String arg[])
ob.readsent();
ob.arrange();
}
}