Java Programming using array

Ads
 

Java Programming using array

I'm creating a programming using array that will accept 10 letters and test if those letters are consonant, then it will display on the screen. Please guide me.

Sample Output:

Enter 10 letters.

A

B

C

D

E

F

G

H

I

J

The Consonants entered are

B

C

D

F

G

H

Program:

import java.io.*; public class Array {

public static void main(String args[]) throws IOException
{
    BufferedReader k = new BufferedReader(new InputStreamReader(System.in));
    char[] srcArray = new char[] = {'B', 'C', 'D', 'F', 'G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z'};
    char ch=;
    System.out.println("Enter 10 letters");
    for(int x=0;x<10;x++)

    {
        System.out.println(k.readLine());
    }
    if(ch==char[x])
    {
        //Don't know what to put here now.
    }
    else
        System.out.println("Wrong Input!");
}

}

Help me out please.

View Answers

March 13, 2013 at 12:59 PM

hi friend,

Try this sample code may, this will be helpful for you.

    package net.roseindia;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class CheckForVowel {

    public static void main(String args[]) throws IOException
    {
        char n;

        BufferedReader s=new BufferedReader (new InputStreamReader
                (System.in));

        System.out.println ("Enter letters : ");
        String letter = s.readLine();
        for(int i=0; i<letter.length(); i++)
        {
        n= letter.charAt(i);        
        if (n=='a'|| n=='e'|| n=='i'|| n=='o'|| n=='u'|| n=='A'||
                n=='E'|| n=='I'|| n=='O'|| n=='U')
        System.out.println ("Vowel = "+n);
        else
        System.out.println ("Consonant = "+n); 
        }
    }
}

Ads









Related Tutorials/Questions & Answers:
Java Programming using array
Java Programming using array  I'm creating a programming using array... Program: import java.io.*; public class Array { public static void main(String args...','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z'}; char ch
Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program... and column indices with the most 1s. Here are the output required: Enter the array
Advertisements
Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program... and column indices with the most 1s. Here are the output required: Enter the array
How to using Binary Search Array Java ?
How to using Binary Search Array Java ?  Hi, I am beginners in Java Programming Language. I am trying to create small application using Array functions. The problem is that how to use binary search array in Java. Please give
one dimensional array using java
one dimensional array using java  design and implement a java program that will read a file containing numbers and compute the following statistics: the range(low,high) the average and the median
Java using Netbeans Object Oriented Programming
Java using Netbeans Object Oriented Programming   I am trying to make... strings and a set of numbers for an array. This array is then sorted in descending... the ,average and mean values of the array and returns that as another array. My code
Java Programming using Netbeans - IDE Questions
Java Programming using Netbeans  Hello Dear sir, i got one scenario... & address using netbeans jframe then i have to store these data into my package so... visit the following link: http://www.roseindia.net/java/example/java/swing/add
how to convert string to char array in java without using tochararray
how to convert string to char array in java without using tochararray ...() function. how to convert string to char array in java without using... to char array in java without using tochararray: package my.app; public
Convert a string representation of a hex dump to a byte array using Java?
Convert a string representation of a hex dump to a byte array using Java?  Convert a string representation of a hex dump to a byte array using Java
Display tow dimensional array using one for loop in java
Display tow dimensional array using one for loop in java  Display tow dimensional array using one for loop in java
using array
using array  Circular left shift array element by one position
using array
using array  Circular left shift array element by one position
Display tow dimensional array by matrix form using one for loop in java
Display tow dimensional array by matrix form using one for loop in java  Display tow dimensional array by matrix form using one for loop in java
how to Insert Array Values Into Separate Rows using java?
how to Insert Array Values Into Separate Rows using java?  how to Insert Array Values Into Separate Rows using java?  class...) { String array[][]={{"1","Angel","Delhi"},{"2","John","Chennai"},{"3","William
using array
using array  display 10 digit number using array and print pyramid. 1 1 1 1 1 1 1 1 1 1 1 1
Java array
Java array  Java program to find first two maximum numbers in an array,using single loop without sorting array
using array
using array  transpose a matrix
using array
using array  transpose a matrix
using array
using array  column wise total of a matrix
using array
using array  read 10 digit number and display (star
using 2D Array
using 2D Array  Write a JAVA program using 2D Array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C... the class average. Define the exam answer key as Final Array in your program
using 2D Array
using 2D Array  Write a JAVA program using 2D Array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C... the class average. Define the exam answer key as Final Array in your program
ask user how many numbers to be inputted and determine the sum and highest number using an array in java
ask user how many numbers to be inputted and determine the sum and highest number using an array in java  ask user how many numbers to be inputted and determine the sum and highest number using an array in java
Java Programming
Java Programming  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
What is Array in Java?
What is Array in Java?  Hi, What is Array in Java? How to create an array in Java and use it? Thanks   Hi, Array is very important in Java as it is used heavily in programming. Array is Java is a container object
java programming
in question Implement the program described above using the Java programming language...java programming   Companies and people often buy and sell stocks... will be using a queue for storing data for FIFO accounting, and a stack
java programming
in question Implement the program described above using the Java programming language...java programming   Companies and people often buy and sell stocks... will be using a queue for storing data for FIFO accounting, and a stack
Explain the process of implementing a CORBA client using a Java programming example and the steps involved.
Explain the process of implementing a CORBA client using a Java programming example and the steps involved.  plz tell me answer of this question... the process of implementing a CORBA client using a Java programming example
Finding duplicates using array in for loop
Finding duplicates using array in for loop  how to find the duplicates in array using for loop
java programming
of the string, not storing them in an array and then finding the longest word using.(without using scanner class...java programming  WAP to find the longest word from a user given
Java Array
Java Array   a) Write an array program that perform the following: i) Declares a String array initialized with the following strings: â?...??. ii) Write a loop that displays the contents of each element in the array

Ads