Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
Tracie Marshall
Greenhorn
+ Follow
news
1
Posts
1
Threads
since Jan 24, 2010
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads
Recent posts by Tracie Marshall
Java array help
So, I have this code and I have an array of alphabets which I've copied into a new array. No I need to go through the array and print the vowels "a,e,i,o,u" in uppercase. I was wondering if anyone could help me.
Thanks!
public class Alphabet { // Fill an array with the alphabet private static String[] alphabet = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; private static String[] alphabet2 = new String[alphabet.length+1]; // Main public static void main(String[] args) { // Scanner Scanner console = new Scanner(System.in); // Asks the user for a position in the alphabet between 0 and 25 System.out.println("Select the position to print by entering a value between 0 - 25"); // Finds the index int theIndex = console.nextInt(); // Prints the requested position and the letter at the position System.out.println("The letter of the alphabet at position "+ (theIndex) + " is : " + alphabet[theIndex]); System.arraycopy(alphabet, 0, alphabet2, 1, alphabet.length); System.out.println("The letter of the alphabet at position "+ (theIndex) + " is : " + alphabet2[theIndex]); for(int i = 0; i < alphabet2.length; i++){ if(){ } } } }
show more
15 years ago
Beginning Java