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



Home Answers Viewqa Java-Beginners please help me to solve this question about array

Have Programming Question? Ask it here!
 
 
 


nur
please help me to solve this question about array
2 Answer(s)      3 years and 10 months ago
Posted in : Java Beginners


write a program thatt stores vowels (a,e,i,o and u)in an array. Ask the user to enter any character. The program should ignore the case of that character (uppercase or lowercase) and determine whether the entered character is vowel or not.


Advertisement
View Answers

November 9, 2010 at 3:42 PM


import java.util.Scanner;

public class Example1 {

public static void main(String[] args) {
    char arr[] = { 'a', 'e', 'i', 'o', 'u' };
    String brr;
    boolean flag = false;
    Scanner sc = new Scanner(System.in);
    char ch;
    System.out.println("Enter any character:");
    brr = sc.nextLine();
    if (brr.length() > 1)
        System.out.println("It is not character. Please enter character");
    else {
        ch = brr.charAt(0);
        System.out.println("It is character. " + ch);
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == ch) {
                flag = true;
                break;
            }
        }
        if (flag)
            System.out.println(ch + " is vowel.");
        else
            System.out.println(ch + " is consonant.");
    }
}

}

Is this code is fruitful for you.

+++++++++ knapster +++++++++



November 9, 2010 at 4:25 PM


import java.util.Scanner;

public class Example1 {

public static void main(String[] args) {
    char arr[] = { 'a', 'e', 'i', 'o', 'u' };
    String brr;
    boolean flag = false;
    Scanner sc = new Scanner(System.in);
    char ch;
    System.out.println("Enter any character:");
    brr = sc.nextLine();
    if (brr.length() > 1)
        System.out.println("It is not character. Please enter character");
    else {
        ch = brr.toLowerCase().charAt(0);
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == ch) {
                flag = true;
                break;
            }
        }
        if (flag)
            System.out.println(brr + " is vowel.");
        else
            System.out.println(brr + " is consonant.");
    }
}

}



Related Tutorials/Questions & Answers:
Please help me about maven2 plugin - Maven
Please help me about maven2 plugin  First, thanks you for your all tutorial. That are the best tutorial i've learned. Then, I want to ask you about... an error. I send you the image i capture the error Please help me
Please help me urgent...........
Please help me urgent...........  For what kind of a problem would use a Tree Set and not a Tree Map For what kind of a problem would use a Tree Map and not a Tree Set   Hello Friend, If you want to display the list
Advertisements
Help me please!!! - Java Beginners
Help me please!!!  im badly needing the complete code for this project in java!!! can you please help me???!!! it is about 1-dimensional array... the answers 8Hours from now!!! Kindly help me!! please!!please!!! NOTE
Please help me to learn - WebSevices
Please help me to learn  Please help me to learn Java Fast
please help me here.. - Java Beginners
please help me here..  ..uhhmm.. im a little bit new to java and i go confused on my case study.. import java.lang.*; import java.io.*; public... if the first string is part of the second string... ..help..  Hi friend
Please help me fix this code - MobileApplications
Please help me fix this code   Please help me in this area of code. i used three record store for each form I want expenses button... expenses)", "Please fill all required field \n \n * This signify required field
Plz help me with this Question - Java Beginners
Plz help me with this Question  this is java code ------------------------- Consider the following code: int [ ] a = [1, 2, 3]; Object o ="123"; String t = "12"; String w = t + "3"; Boolean b = o.equals (a); Boolean b2
sir i,have a assignment for these question plz help me sir - JavaMail
sir i,have a assignment for these question plz help me sir   1.Design a Java interface for ADT Stack. Develop two different classes that implement this interface, one using array and the other using linked-list. Provide
Please Help
Please Help  How do I create an attribute that represents the following: A grayscale 'color' value, that is, an integer between 0 and 255 inclusive, where 0 corresponds to the darkest black and 255 to the brightest white
please guide me - EJB
please guide me  Hi I am Pradeep singh ,done SCJP 5.0 and SCWCD 5.0 .Now i want to learn further .So please tell me whether should i learn EJB 3.0... advice me .At present i am jobless
Please answer me - JSP-Servlet
2000 NOT MySQL. Please assist me and for other questions I've asked before...Please answer me  Hello Guys, this is the third time I'm sending this question. But I've not got the right answer from you. The again is: I need java
please help - JSP-Servlet
To Year "> please help...please help   i am making a program by this i can find out...')){ document.getElementById('combo').style.visibility = 'visible'; var arr = new Array(); arr[11
please send me the answer - JDBC
please send me the answer -difference between DriverManager and DataDourse   what is Datasourse? What r the advantages? what is the difference between DriverManager and DataDourse
Please guide me sir - EJB
Please guide me sir  Hi I am Pradeep singh ,done SCJP 5.0 and SCWCD 5.0 .Now i want to learn further .So please tell me whether should i learn EJB... next? Because both can do same work.Please advice me .At present i am jobless
help please - Java Beginners
help please  i wrote this program but the function newLine dosnt work with me and i dont know where is exactly the error this is the code i wrote import java.io.*; import java.util.*; import java.lang.Integer
help me - Java Beginners
help me  helo guys can you share me a code about Currency Conversion.Money will convert according to the type of currency.would you help me please... into 2 decimal places sample 1.25) Mexican_________ guys help me..thank
HELP ME - Java Beginners
HELP ME  How can I write only digits in the the textfield when I am using keyTyped and keyPressed metods of KeyListener, but I do not want to write an any character in it?(This question means when a user pressed a key in keyboard
Help me - Java Beginners
Help me  please help me in writing a program in java "A student has a name,roll no., class, home address, date of birth. First dessigne a suitable class for date, write constructor and get and set functions. Then dissign a class
help me - JSP-Servlet
help me   how to open one compiled html file by clicking one button from jsp
Help me quickly plz??
Help me quickly plz??  Can you help me to write code quickly this code is a java code take input as double and should use command line arguments and enhanced for statement then find the combine of the numbers plz help quickly
hi frnds.. help me..
hi frnds.. help me..  i ve a doubt in incompatible type error (block letter). plz help me clear this error! thanks in advance. This is my code. double velo[][] = new double [task] [resource]; for(int i=0;iList<Double>
Please check it and let me know - Java Beginners
Please check it and let me know  Hi friends, your las suggession is not ok becoz this code give some error and problem,Today i m sending all code and requirement please check it and solve again thanks Requirements:- I
please help in jsp - JSP-Servlet
please help in jsp  i have two Jsp's pages. on main.jsp have some list of schools. from there i can go home page of any school. home.jsp represents... please help.  Hi Friend, Try
help me - Java Beginners
help me   i want to create a login form in java with jdbc connection in ist form there will two label for passworrd and user name and two button one button for login and another for new user if anybody click into login
The second Question is very tuff for me - Java Beginners
The second Question is very tuff for me   You are to choose between two procedures, both of which compute the mini-mum value in an array of integers. One procedure returns the smallest integer if its array argument is empty
please convert for me this code to GUI - Swing AWT
please convert for me this code to GUI    THE CODES ARE BELOW...; } else screen.displayMessageLine( "\nInvalid account Nummber or PIN, Please...; screen.displayMessageLine("\n Your cash has been"+ "dispensed. please take your cash
please convert for me this code to GUI - Swing AWT
please convert for me this code to GUI  THE CODES ARE BELOW, CLASS ATMCaseStudy is the driver class that runs all the other classes. its very urgent... account Nummber or PIN, Please try again."); } private void
plz Help me - Java Beginners
plz Help me  Hi, I want learn struts,I dont have any idea about this plz help how can i make a framework.If u have any information then plz send my personal id plz tell me that whose software installed.and give me brief
Netbeans Question need help desperately!!
Netbeans Question need help desperately!!   Ok here is my code- public class RollDie2 { public static void main(String[] args) { Random... a two-dimensional array to tally the actual combinations of rolls on 8 sided
help me in these - Java Interview Questions
help me in these  hello every body i have some question if you cam plz answer me it is important to me and these are the questions : 1)Write... in the array . use linear search for this algorithm . test your method. answer me
plz help me - Java Beginners
plz help me  Deepak I can write a sessioon code plz help me admin_home.jsp page is display but data is not disply plz help me what is wrong
pls. help me - Java Beginners
pls. help me  please help me i do need now if its okay... Consider the method headings: void funcOne(int[] alpha, int size) int funcSum(int x,int y) void funcTwo(int[] alpha, int[] beta) and the declarations: int
plz help me - Java Beginners
plz help me  Hi, I want to search all field from database using name, and display in text box, then data is update and delete. i want to search name using alphabets a-z, plz reply fast. plz help me this is very urgent
Struts2 Helloworld problem -Please help - Struts
. Please help me out in resolving this problem and provide me a pointer...Struts2 Helloworld problem -Please help  Hi I am a beginner... problem I unable to execute the program successfully. Please find my example
could any one help me?
could any one help me?  I'm a student in the faculty of computer and information science we will make graduation project "taxi dispatcher" we need to use mobile "x6 nokia" in car and send the coordinate of car through gps which
plz help me!!!!!!!! - JSP-Servlet
plz help me!!!!!!!!  i`ve set the environment varaibles for tomcat as well as jdk.. but i`m not understanding where i`ve to save my servlet..i.e.... there are compilation errors.. plz do help me.   make sure that you did
plz help me - Java Beginners
plz help me  Thanks deepak continue response..i face some problem i hv a these file index.jsp,sessionvalid.jsp, both r store in project folder... give me reponse my persinal given id  Hi ragni, i am sending
help me for doing project - Java Beginners
help me for doing project  i am handling the project that "email... the email headers and how to display the port and user's information please help me thanks in advance who are going to help me bhanukiran
Help Me With This Plz - Java Interview Questions
Help Me With This Plz  Write a program that's print a word like(I S E) on the black screen with 0,1 only by using two dimensional array? the 1's will represent the words
Help me on database connectivity in J2ME - Java Beginners
Help me on database connectivity in J2ME  i want help in J2ME. i want code for database connection with MySQL. spcl to fecth and insert data from databse. please help me
Netbeans Array help
of rolls possible within the array Help plese!   Hi Friend, Try...Netbeans Array help  Ok here is my code- * * To change this template... array to tally the actual combinations of rolls. A roll of 2 and 7 would
hello sir, please give me answer - Java Beginners
hello sir, please give me answer  Write a program in Java that calculates the sum of digits of an input number, prints... ways in java? so , sir please tell me full solution of this program   Here is your complete
plz help me - Java Interview Questions
plz help me  1)Rewrite the method in exercise 10 such that it use...; if the array or sorted , the high-speed binary search can be used as follow: "the algorithm locates the middle array and compares it to the search value
Please give me the code for the below problem - Java Interview Questions
Please give me the code for the below problem  PROBLEM : SALES TAXES Basic sales tax is applicable at a rate of 10% on all goods, except books, food, and medical products that are exempt. Import duty is an additional sales tax
help me on jstl- <c:url> - JSP-Servlet
help me on jstl c:url  what is jstl in java
Plz help me in writing the code - Java Beginners
Plz help me in writing the code   Write a two user Chess Game. (users must be on different systems
Easy Counting Java Program...Please Help? - Java Beginners
Easy Counting Java Program...Please Help?  As I said, I am a beginner at Java. I came across this problem that Im sure uses java. Could you please... someone PLEASE give me this code? I would really love to know this program! THANK
java, plz help me in doing this - Java Beginners
java, plz help me in doing this  # Write a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record.....giving me the error of NoClassDefFoundError
Plz help with third Question - Java Beginners
Plz help with third Question  1)- Specify and implement a procedure that determines whether or not a string is a palindrome. (A palindrome reads the same backward and forward; an example is "deed
plz help me today plz plz - Java Interview Questions
plz help me today plz plz  2.) Suppose list is an array of six... the array stores the value of i after multiplying with 2 and adding with 5. If the value of i after dividing it with 2 results 0 then subtract this array value by 3
Advertisements
 

 

 

DMCA.com