Write a program (Using Scanner Class) to enter a token / word in mixed case and
display the new token after deleting all the vowels.
Sample input: Computer
Sample Output: Cmptr
Answers
Answer:
Program to enter a token/word in a mixed case and display the new token
after deleting all the consonants*/
import java.util.Scanner;
public class vowels
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
String st, ns="";
int i,len;
char ch;
System.out.println("Enter a token/word");
st=sc.next();
len=st.length();
// Extracting only consonants leaving vowels from the entered token
for(i=0;i<len;i++)
{
ch=st.charAt(i);
if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
ns=ns+ch;
}
System.out.println();
System.out.println();
// Printing the new token with consonants only
System.out.println("The new token after deleting all the consonants : "+ns);
}
}
Answer:
please mark me brainlist