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



Home Answers Viewqa Java-Beginners Java Programming using array

Have Programming Question? Ask it here!
 
 
 


Zofrente Valenzuela
Java Programming using array
1 Answer(s)      a year and 5 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
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
using array
using array  column wise total of a matrix
using array
using array  read 10 digit number and display (star
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 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 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 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 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
Java Programming  Using Java Frame form, help me develop a GPA calculating device, able to show Grade and points together, and using MySQL database
Java Programming
Java Programming  Using Java Frame form, help me develop a GPA calculating device, able to show Grade and points together, and using MySQL database
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
java programming
java programming  Hi friends i need simple login form coding using two labels,two textfields and two buttons in netbeans without using database connection. . if you know that logic please tell
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  WAP to accept 10 strings from the user and find out the string with maximum length and print the same.   Here is a code that accepts 10 strings from the string and stored into array and then find
java programming
java programming  A computer is used to count the votes in an election. At the start of the election, the number of candidates standing is entered.... The program then counts this vote in an array. If an elector keys in a number outside
java programming
java programming  Hi friends, i need a simple login form source code. in that program i have two labels,two text fields and two buttons namely ok and cancel buttons. how to write for that one using netbeans without database
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
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
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
Java Programming  Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the student√?¬Ę√Ę‚??¬¨√Ę‚??¬Ęs programming mark. Determine how many student get A+ and A for their grade
Java programming
Java programming  What is the Role of OOP in java
Java programming
Java programming  What is the Role of OOP in java
java programming
java programming  How can be uesd in graphiclly view for user inter (x,y) cordinate and show the output shart point to end point. java code... = ChartFactory.createXYLineChart ("XYLine Chart using JFreeChart", "Age", "Weight", xyDataset
java programming
java programming  How can be uesd in graphiclly view for user inter (x,y) cordinate and show the output shart point to end point. java code... = ChartFactory.createXYLineChart ("XYLine Chart using JFreeChart", "Age", "Weight", xyDataset
java programming
java programming  How can be uesd in graphiclly view for user inter (x,y) cordinate and show the output shart point to end point. java code... = ChartFactory.createXYLineChart ("XYLine Chart using JFreeChart", "Age", "Weight", xyDataset
java programming
java programming  Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the student‚??s programming mark. Determine how many student get A+ and A for their grade and how many
java array
java array  q4.array Write a program that accepts two arrays, an array of fruit names and an array of price of fruits, and a fruit name and returns the price of the fruit. (Assume that a price in the second array corresponds
java programming
java programming  how to write a coding for simple login form in netbeans
java array
java array  write a java method that takes an array of float values...)){ System.out.println("There are duplicate elements."); Float array...++){ array[i]=new Float(arr[i]); } Set<Float>
Advertisements
 

 

 

DMCA.com