Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Java Programming using array
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Zofrente Valenzuela
Java Programming using array
1 Answer(s)      a year and 6 months ago
Posted in : Java Beginners


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.


Advertisement
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); 
        }
    }
}


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
java programming using RMI - RMI
java programming using RMI  Write a program using RMI to sell an item to the customer remotely and don't allow the customer to purchase the item if the stock is nil , by displaying an appropriate message
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
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
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
using array
using array  Circular left shift array element by one position
using array
using array  Circular left shift array element by one position
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
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  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
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
How to Create a ByteBuffer using Byte Array in java.
How to create a ByteBuffer using Byte Array in java.      ..., we will discuss how to creates a buffer using byte array. The ByteBuffer ... Description static ByteBuffer wrap(byte array
Java array
Java array  Java program to find first two maximum numbers in an array,using single loop without sorting array
Java Programming
Java Programming  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
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
Java - Array in Java
Array Example - Array in Java       Array: Array is the most important thing in any programming... of the program: C:\chandan>javac array.java C:\chandan>java array Given number
Java programming
Java programming  To make a fraction to a representation base 16... by 16 gets the second digit and so on. Write a method that accepts an array of digits (base 10) and creates and returns a new array representing the same fraction
Java array
Java array   How can one prove that the array is not null but empty
Use of Array in Java
Use of Array in Java       This Java programming example will teach you the the concepts of arrays so... way to create a array is by using new operator. e.g.. : a = new int[5
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
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
Insert excel file data into database Using Java Programming
excel file data into Database Using java programming: import java.io....Insert excel file data into database in Java Program In this PHP tutorial section, you will learn how to insert excel file data into the database. We have
 

 

 

DMCA.com