Home Answers Viewqa Java-Beginners Java Programming using array

 
 


Zofrente Valenzuela
Java Programming using array
1 Answer(s)      2 months and 10 days 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.

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 Pages:
Java Programming using array
Java Programming using array  I'm creating a programming using array that will accept 10 letters and test if those letters are consonant... Program: import java.io.*; public class Array { public static void main(String args
Array
Array  can we create an array of size 1 lakh in java programming
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 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
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 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: Solution to Programming Exercise
. That array is sorted using selection sort, and then the array is printed... Solution for Programming Exercise 8.2 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
Java array - Java Beginners
array A of size NxN without using any other array ie. each a[i][j]witha[j][i...-- programming java hello would be displayed as hello java programming...[]) { String str[] = "programming java hello".split(" "); System.out.println
Java Programming: Solution to Programming Exercise
an array of ints to store the counts. This would be using "parallel arrays... Solution for Programming Exercise 10.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
Java Programming, Solution to Programming Exercise
Solution for Programming Exercise 12.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... as a queue by using the addLast() and removeFirst() methods to enqueue
Java Programming: Solution to Programming Exercise
into each place in the array. Even in Java, if you wrote this program differently... Solution for Programming Exercise 8.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 8.4 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook. Exercise 8.4: For this problem, you will need to use an array of objects
Java Programming, Solution to Programming Exercise
Solution for Programming Exercise 11.2 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... Section 10.3, that stores words in a binary sort tree instead of in an array
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 8.3 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook.... The lines and polygons can be drawn using a graphics context, g, obtained
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 10.3 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... the "dynamic array" technique to allow an unlimited number of entries. The original class
Java array in currency converter
Java array in currency converter  Hi all, My sister is trying to teach me java. She's in school for programming and I'm not but I am just trying...¢â?¬â?¢ then, using your array of objects, display the following report: Item
Java array
Java array  Java program to find first two maximum numbers in an array,using single loop without sorting array
Java programming 1 - Java Beginners
Java programming 1  Thx sir for reply me ^^ err how bout if using scanner class or further method to solve that code? instead of using array?  ...://www.roseindia.net/java/java-tips/examples-introductory/console/console-input
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
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 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
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 problem - Java Beginners
Java programming problem  could anyone help me to solve this problem... that will -Read total number of persons -Declare an array of objects to hold the persons using polymorphism -For each person, read in the type of person (Student
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: Section 8.1
. Each item is referred to using a field name. In Java, field names are just... is called the base type of the array. The base type of an array can be any Java... -- are more often referred to as the elements of the array. In Java, the elements
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
Java Programming: Section 8.2
. Copying values from one array to another is such a common operation that Java... a copy of the array, A, using this subroutine, you would say..., A.length ); An array type, such as double[], is a full-fledged Java
Java Programming: Section 8.3
support for generic programming. Java does not, at least not quite. We can come close to generic programming in Java by working with data structures... OF AN ARRAY is fixed when it is created. In many cases, however, the number
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
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: Chapter 8 Index
and so basic that it is built into every programming language: the array... the items are of the same type. In Java, the items in an array are always.... The items in an array can belong to one of Java's primitive types. They can
Java Programming: Section 8.4
of way, using an array of numbers as an example. In practical situations, though..., of the number of items in the array.) In order to make binary search into a Java... Section 8.4 Searching and Sorting TWO ARRAY PROCESSING
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
Java Programming: Section 8.5
-class Java type, you can have an array of arrays. For example, an array... if Java were available.) I will only cover a part of the programming... AS THE BASE TYPE FOR AN ARRAY. You can have an array of ints, an array of Strings
Java Programming: Section 12.1
and interfaces that are used for generic programming in Java. We will spend...++ can't use Java's style of generic programming either. Nevertheless, C++ has...++. Generic Programming in Java Like C++, Java is a strongly typed language
Java Programming: Section 12.3
"fred" in the associative array A. Java does not use array notation for maps... is really no more difficult to use than a standard array. Java includes two classes... + ")" ); } Maps are not the only place in Java's generic programming framework
Java Programming: Section 12.2
using array-like indexing with the methods get(index) and add(index,obj... elements in the first N positions. Java does not support generic programming... looked at the general properties of collection classes in Java. In this section
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
How to convert Arraylist into String Array Java
into string array using java language. Please visit the below link: http... of Java programming. Can somebody Suggest me how to convert arraylist to string array in Java. Please suggest any online example. Thanks   Hi, I
Java Programming: Section 9.1
to the inventors of Java, can be traced to programming languages themselves. Java... cases where the designers of Java have taken these approaches. An array...], and so on refer to memory locations beyond the end of the array. In Java, an attempt
Java Programming: Section 4.5
of the computations they perform. The Java programming language is supplemented..., this can get tiresome, so Java makes it possible to avoid using the full names... Java environment you are using. Most commonly, classes in a package named
An Overview of Java      Java is a programming language      Java is Object Oriented Programming
; Java as a programming language Java is an Object oriented application programming language developed by Sun Microsystems. Java is a very... with Java programming, we must know the significance of Java Compiler. When
Java Programming: Section 10.3
Section 10.3 Programming With Files IN THIS SECTION, we look at several programming examples that work with files. The techniques that we... the input file. We can store the words in an array, but since there is no way
Java Programming: Section 9.3
and bad array indices. This is a case where careful programming is better than... value to the array M. You would certainly resent it if the designers of Java... that can occur when using Java's input/output routines. This means that you

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.