File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Looking For A Solution!!!!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Looking For A Solution!!!!!! " Watch "Looking For A Solution!!!!!! " New topic

Looking For A Solution!!!!!!

Khalid Askar

Joined: Dec 25, 2004
Posts: 2
Hello every one!

I am new to the java programming language and I need a solution for the below exercise.

Q-Write a program to generate a random sequence of capital letters that does not include vowels?

Thanks in advance,
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
since this sounds like a assignment i give you some hints instead of the full solution:

- Math.random() produces a random number between 0 and 1. You can multiply/round/cast this number to get a valid index to an array
- You could create an char[] with all the required letters (something like {'B', 'C'})

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Another first post! Welcome aboard!

Pascal's answer is typical in the beginner forum ... just enough hints to get you going, but not complete solutions. Please give it a try and feel free to post code as you make progress or run into trouble.

If you're not familiar with the JavaDoc, this is a great resource. Bookmark it today:
[ January 03, 2005: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: Looking For A Solution!!!!!!
It's not a secret anymore!