File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Looking For A Solution!!!!!!

 
Khalid Askar
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 547
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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'})


pascal
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://java.sun.com/j2se/1.5.0/docs/api/
[ January 03, 2005: Message edited by: Stan James ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic