Share on Google+Share on Google+

siti umairah
2 Answer(s)      6 years and 7 months ago
Posted in : Java Beginners

i have to write a program that 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.

View Answers

October 30, 2010 at 10:56 AM

Hello Friend,

Try the following code:

import java.util.*;
class Vowel 
    public static void main(String[] args) 
        char charr[]={'a','e','i','o','u'};
        Scanner input=new Scanner(System.in);
        System.out.println("Enter a character: ");
        char ch=input.next().toLowerCase().charAt(0);
                System.out.println("Entered character is vowel");
                System.out.println("Entered character is not a vowel");



October 30, 2010 at 12:56 PM

tq so much 4 helping me...i really appreciate it... :)... i've another question..n try to do it...

an internet service provider has three different subscription packages for its customers:

package A : for RM9.99 per month 10 hours for access are provided. additional hours are RM2.99 per hour.

package B : for RM19.99 per month 20 hours of access are provided. additional hours are RM1.99 per hour.

package C : for RM29.99 per month unlimited access is provided.

write a program that calculates a customer's monthly bill. it should store the letter of the package that customer has purchased (A,B or C) and the number of hours that were used. the program should display the total charges.

here my coding so far...

import java.util.*; public class MonthlyBill { public static void main (String[]args) { double payrate=0; int hours;

 Scanner scan=new Scanner(System.in);
  System.out.println("Enter customer's name: ");
  String name=scan.nextLine();

  System.out.println("Enter package('A' or 'B' or 'C') : ");
  String pack=scan.nextLine();

      System.out.println("Enter your customer's hour here:");
      int hour=scan.nextInt();

      if(hours >= 10)
      payrate= payrate * 2.99;

  else if(pack.equalsIgnoreCase("B"))
      System.out.println("Enter your customer's hour here:");
      int hour=scan.nextInt();

      if(hours >= 20)
      payrate= payrate * 1.99; 

  else if(pack.equalsIgnoreCase("C"))
      System.out.println ("No extra charge for your additional hours");
      System.out.println ("You get unlimited access");

      System.out.println ("Total monthly bill \n" + payrate);     



i think there is so many error...please try check it out..


Related Tutorials/Questions & Answers:
Java Error in Hello World  Java Error in Hello World
Java Hello World  HELLO World program in Java
Hello  Hello sir i want to store upload doc file in ms access by using servlet. Can i store file in access.one another things access only text size is 255 character but my file is up to 2mb how i can store
Hello ..
Hello ..  Hello, I need a code for .. Want to read csv file (which is having name nd mobile number) from jsp and if i give search by name mobile number should get displayed and if i give mobile number name should get
there is so many error...please try check it out..   Hello Friend, We have
character is vowel or not.   Hello Friend, Try the following code
Hello Eyeryone...
Hello Eyeryone...  how to download java material in roseindia.net website material please kindly help me... by visu
Hello world
Hello world (First java program)   ... and can be run on any operating System. Writing Hello World program is very simple. To write the Hello world program you need  simple text editor like note
print hello n hi
print hello n hi  how to write a java program that prints "hello" 5 times, "hi" 1 time n again "hello" 4 times..?? do reply
Hello world program
Hello world program  hello world program   class Hello{ public static void main(String[] args) { System.out.println("Hello World"); } } For more information, visit the following link: http
hello in vertical manner
hello in vertical manner  How to print HELLO as in vertical manner   Hi, Try this: class HelloExample { public static void main(String[] args) { String str="HELLO"; char ch[]=str.toCharArray
Hello World in servlet
Hello World in servlet  Hello World example in servlet ?   import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public..., IOException { PrintWriter out = res.getWriter(); out.println("Hello
Hello World - Java Beginners
Hello World  Java Beginner - 1st day. Looked at the Hello World script and thought I would give it a try....I created the script in Notepad. Saved...){ System.out.println("Hello World!"); } } what am I doing wrong. Am I expecting
Hello - Java Beginners
Hello  Hello I have a two button update and delete I want to user click on update button then msg will be displayed in msg box Are u sure want to update If user click yes then all record will be updated
J2ME Hello World Example
J2ME Hello World Example       This is the simple hello world application. In this example we are creating a form name "Hello World" and creating a string message "
Hello World Program
Hello World Program  write a java program that continuously prints HelloWorld! to the screen(once every second ) and exists when press the enter key... = new DisplayMessageContinuously("Hello World ", 1000); th.start
EJB Hello world example
EJB Hello world example       Creating and testing the "Hello World" Example is the very first... example we are going to show you, how to create your first hello world example
hello there i need help
hello there i need help  : i need to do a program like this: Automatic Teller Machine [B] Balance [D] Deposit [W] Withdrawal [Q] Quit select you OPtions: once i have chosen an option then i should proceed here if i choose b
pring Hello World Application
Spring Hello World Application       Hello World Example using Spring, The tutorial given below describes you the way to make a spring web application that displays Hello World
Java Hello World code example
Java Hello World code example  Hi, Here is my code of Hello World program in Java: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World
java hello and timer alert application
java hello and timer alert application  Hi, Please help me create a simple Java application that can display "Hello world" and current Time alert on mobile device screen using mobile screen emulator. Regards
How to create Applet Hello World?
How to create Applet Hello World?  Hi, What is Applet in Java? How to create Applet Hello World? Thanks   Hi, Applet is Java Program..." WIDTH=700 HEIGHT=500> Java - Applet Hello World. Thanks
TIBCO Designer Tutorial - Hello World
TIBCO Designer Tutorial - Hello World  This TIBCO tutorial teaches you how to create a process definition that writes the words "Hello, World... output "Hello, World!" into the file. This task requires knowledge of the file
jQuery Hello World
jQuery Hello World example     ... application called "Hello World jQuery". This application will simply display...'s start developing the Hello World application in jQuery. Setting up
Smarty Hello World Program
How to write "Hello World" program? In any smarty program we need two files: a) .php file and b).tpl file.     i) .php file: Which...;//enable the caching   $smarty->assign ('name', 'hello world
Spring Hello World prog - Spring
Spring Hello World prog  I used running the helloworld prog code mentioned in http://www.vaannila.com/spring/spring-mvc-tutorial-1.html I'm getting null pointer exception. as shown below. I added all the jars and my