Home Answers Viewqa Java-Beginners accept sentence from user and print all word starts with vowel and end with consonent

 
 


Nishant Jain
accept sentence from user and print all word starts with vowel and end with consonent
1 Answer(s)      2 years and 3 months ago
Posted in : Java Beginners

Write a program to accept a sentence. Print all the words that starts with vowel and end with a consonant. e.g. input by user "the purpose of education is to replace an empty mind with an open one" Ist output of open one education empty is an an the purpose to replace mind with

and Second IInd output of education is an empty an open one the to replace mind with

View Answers

February 23, 2011 at 3:35 PM


Java accept sentence from user and print all word starts with vowel and end with consonant

import java.util.*;
class StringExample6 
{
    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.println("Enter string:");
        String str=input.nextLine();
        StringTokenizer stk=new StringTokenizer(str);
        String vowels="",consonants="";
        while(stk.hasMoreTokens()){
            String token=stk.nextToken();
            if(token.startsWith("a")||token.startsWith("e")||token.startsWith("i")||token.startsWith("o")||token.startsWith("u")){
            vowels+=token+" ";
            }
            else if(!token.startsWith("a")||!token.startsWith("e")||!token.startsWith("i")||!token.startsWith("o")||!token.startsWith("u")){
            consonants+=token+" ";
            }
        }
        System.out.println("Second Output: "+vowels.concat(consonants));
    }
}









Related Pages:
accept sentence from user and print all word starts with vowel and end with consonent
accept sentence from user and print all word starts with vowel and end with consonent  Write a program to accept a sentence. Print all the words that starts with vowel and end with a consonant. e.g. input by user "the purpose
vowel
vowel  display all the vowel from word/string   import java.util.*; class DisplayVowels { public static void main(String[] args... word/string:"); String str=input.nextLine(); String vowels
accept integer from user
accept integer from user  Write an Java application that accepts 100 integer numbers from a user. The input should be in the range of 1-200. Error message needs to be displayed if user entered input which is not in this range
java vowel program - Java Beginners
java vowel program  Write a program to Print all the words that start with a vowel and end with a consonant. For example : Input :â??the purpose of education is to replace an empty mind with an open oneâ?? Output
Find the percentage of words which starts with a vowel in a file
Find the percentage of words which starts with a vowel in a file   Question: Find the percentage of words which starts with a vowel in a file. Ex: Input: Contents of File1- There is an endless loop in the program. Output: Vowel
print word with max vowels
print word with max vowels  if suppose i hava entered a sentence and in that sentence i have to print a word which has maximum vowels in it.... i have tried it but i am not getting it...please help
button to accept user input
button to accept user input  private void jButton1ActionPerformed... that accepts firstname, lastname and gender from user and insert to database... the radiobutton and spinner.The user input does not show on my Studentinfo.mdb
Display the word that begins with vowel using Java Program
Display the word that begins with vowel using Java Program In this section, we are going to separate the word that begins with vowels from the specified text... '.' or '?' or !. So first of all  we have replaced all these special
viewing the ms word in print layout from jsp - Java Beginners
viewing the ms word in print layout from jsp  Hi all, I am trying to export ms word from jsp in print layout format.I used the code for converting into ms word but it is opening in web layout. My requirement
finout longest word in sentence
finout longest word in sentence  write a program , how to find out the longest word in a sentence using java   Hi Friend, Try...; } } LongestWord(){ String word = ""; for(int i=0;i<stringArray.length;i++){ if(i==0
Finding the longest word in a user given string
Finding the longest word in a user given string  In java, accept a string from the user and find the longest word in it.   The given code finds the longest word from the string. import java.util.*; class LongestWord
Manage end-user state and understand performance tradeoffs of using HTTP sessions
Manage end-user state and understand...; Manage end-user state and understand performance tradeoffs of using HTTP... to a servlet, originating from the same user at the same browser
Write a program in JAVA which accepts a sentence & displays the longest word in the sentence alongn with it length of the word.
Write a program in JAVA which accepts a sentence & displays the longest word in the sentence alongn with it length of the word.  **A program in JAVA which accepts a sentence & displays the longest word in the sentence along
java string vowel program
java string vowel program  java string vowel program   Please visit the following links: Display the word that begins with vowel Java Count Vowels
Accept command in Oracle
the Accept in SQLPlus. SQL> select * from user where username='&user_name' SQL> / Enter value for user_name: Deepak old 1: select username from... command in SQL Plus. The ACCEPT command in SQL Plus is used to take the input from
Determining the Sentence Boundaries in a Unicode String
Determining the Sentence Boundaries in a Unicode String In this section, you will learn how to determine the sentence boundaries in a unicode string. From the previous section, you all are aware of BreakIterator class. This class
Accept Language and Accept Char set in Servlets
sends the user's language to the server using the Accept Language HTTP header... .style1 { font-weight: bold; } Accept Language and Accept Char set in Servlets   
Example - Replace word
Java: Example - Replace word Problem: Write a method to replaces all occurences a word in a string with another word. Assume the method signature... solution This replaces all occurences of a "word", not just the first. 1
Search word from text file using Java
How to Search word from text file using Java In this section, we are going to search a word from the text file. For this, we have created a swing button. On clicking, it will open another window that will ask the user to enter name. When
Print Matchingwords using Regular expression
Print Matchingwords using Regular expression       This Example describe the way to print the matching word from the file using Regularexpression. The steps involved in 
find the first character is vowel or not
find the first character is vowel or not  hi friend, can u plz send me javascript code for find the wether the first character is a vowel or not. 2... wehter it contains a space any where 4)replace all the "a" with "e" 5) extract
ALL command - SQL
user private JREs in the version search -? -help print this help...ALL Command in Java & SQL  Nee all commands in Java.  Dear Manoj, I didn't get u what do u mean by all command. could u please
array accept all data type
array accept all data type  how can create array that accept all data type??? if we can solution it? how..   Hi Friend, Try the following code: import java.lang.reflect.*; class CreateArrayOfAllTypes{ public
array accept all data type
array accept all data type  how can create array that accept all data type??? if we can solution it? how..   Hi Friend, Try the following code: import java.lang.reflect.*; class CreateArrayOfAllTypes{ public
how to print all possible combination that sum to zero??
how to print all possible combination that sum to zero??  Ã?Â.... Print all possible combinations that sum to zero Example Enter a num : 7 1... each of the digits so that the resultant sum is zero. Print all posible
How to insert and update all column values of database from jtable.
How to insert and update all column values of database from jtable.  ... ,update,delete database values from jtable only so i added three buttons add... of particular row is not getting added into the database whereas all other records
How to insert and update all column values of database from jtable.
How to insert and update all column values of database from jtable.  ... ,update,delete database values from jtable only so i added three buttons add,update... row is not getting added into the database whereas all other records are getting
How to insert and update all column values of database from jtable.
How to insert and update all column values of database from jtable.  ... ,update,delete database values from jtable only so i added three buttons add,update... row is not getting added into the database whereas all other records are getting
print
print  How to print JFrame All Componant?   Please visit the following link: http://www.roseindia.net/java/example/java/swing/Print.shtml
Question on reversing word of a sentnce
Question on reversing word of a sentnce  Write a function that accepts a sentence as a parameter, and returns the same with each of its words reversed. The returned sentence should have 1 blank space between each pair of words
retrive data from data base and print it in every page until logout
retrive data from data base and print it in every page until logout  ... the USER NAME through retriving from database.suppose from home page he go to next page that page also contain the USER NAME until he logout. all page are develop
Collections Exercise 4 - Word Translator
: An online dictionary is needed. The user will enter a word and the program...(String word), which returns an iterator over all definitions for the given word.... *@return An iterator over all defintions associated with word
hibernate criteria MatchMode END Example
hibernate criteria MatchMode END Example In this Example, We will discuss... for matching strings using "ilike". The MatchMode.END match the end... = HibernateUtil.getSessionFactory().openSession(); User user = null; try { // Creating
to read number from user
to read number from user  1)print the positive equivalent of the number 2) check if the no is integer or not 3) find the square root of the number 4) find the cube of the number
Reading Files and Print - Java Beginners
that is equal to the user input its gonna print the entire file content. In a case where more than one student are from the same school it should print all... the Particular name "School A" and print all contents in the file(s). I give
Deleting All Rows From the database Table
helps us to write on the browser. To delete all the rows from our database table... then print the message "all rows are deleted" otherwise "no rows has... .style1 { margin-right: 0px; } Deleting All Rows
Java Print the all components
Java Print the all components  This is my code. Please tell me...; ImageIcon images; Container c; Employee_report f1; JButton print; String s,days...(td); np=ge-td; net=Double.toString(np); data = createData(); print=new
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time  I am new developer in .net,I Have requirement..like this ,when user pick date from date picker
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time
How Insert DateTime Vales into Mysql Databse from the front end application.But User Gives Date only from Datepicker,not Time  I am new developer in .net,I Have requirement..like this ,when user pick date from date picker
word program - Java Beginners
ME THANK YOU!!Design a program to search a word for letters that the user...,so your program converts all letters by the user to the same case).You do... within the word a letter that the user entered,change the value of the array
how to match the key word from a text file
how to match the key word from a text file  p>Hi all, I have the code to match the key word and from the text. I have input like this reader.txt...); String[] words = text1.split(" "); for (String word : words) { String regex1
Retrieve a list of words from a website and show a word count plus a specified number of most frequently occurring words
Retrieve a list of words from a website and show a word count plus a specified... int N = 25; //the number of word/frequency pairs to print //word pattern... the document text from the web (provided by utility class) 2.Filter the desired
Display first letter of every word in uppercase
Display first letter of every word in upper case In this Java tutorial section, you will learn how to display the first letter of every word in uppercase. For this, we have allowed the user to enter the string. The BufferedReader class
Java search word from text file
Java search word from text file In this tutorial, you will learn how to search a word from text file and display data related to that word. Here, we have... students. The example prompt the user to enter any student's name
Java check end of file
Java check end of file In this section, you will learn how to check that the file has been read till the end of file. Data has been read one by one from... data. This  indicates the end of file or eof condition. It depends
calculation after if. user input
calculation after if. user input  System.out.print ("please select... user input????   My apologies good evening peoples Once again I am... grateful. As you can see from snippet of code below I can choose 1
from number to word
from number to word  i want to know weather there is any method that can be use in changing value from number to word. Example if i write ten thousand, it will automatically be written as 10000.   Java convert number
JDBC Select All Records Example
; for select  all records from table if exist and defined how the records fetch... extract data from ResultSet  rs one by one row and print also. The  code... = con.createStatement(); String query = "SELECT * FROM user"; ResultSet rs
Counting specific word occurences in a file
Counting specific word occurences in a file  Hello I have a log file from the proxy which consists all the browsing history with date,time,url,ip address etc as fields.Now i need to take only main part of the url like the domain
how to print pdf format
how to print pdf format  Hi every body iam doing school project iam using backend as oracle front end java .how to print student marks list...("Select * from data"); while(rs.next()){ table.addCell(rs.getString

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.