• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Looking For A Solution!!!!!!

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic