isVowel - if (isVowel(letter))...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Scanner; import java.lang.*; import java.io.*; import java.text.*; import java.math.*; import java.text.DecimalFormat; import java.lang.String; // jeremy debruce // 2/16/09 / public class isVowel { public static void main(String[]args) { char letter; String vowel; Scanner Console = new Scanner(System.in); System.out.println(" Please enter a letter"); vowel = Console.next(); letter = vowel.charAt(0);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if (isVowel(letter)) System.out.println(" YEAH!!! This is a vowel."); else System.out.println(" This is not a vowel. Try again"); } public static boolean isVowel(char letter) { switch (letter) { case 'A': case 'E': case 'I': case 'O': case 'U': case 'a': case 'e': case 'i': case 'o': case 'u': return true; default: return false; } } }...
View Full Document

Ask a homework question - tutors are online