and I forgot my semicolons of course :)
Main Topics
Browse All TopicsHey guys,
I need some help with a little project i've got. I've only been working with Java for about 3 months on and off, so be patient with me.
So far I have a loop that requests the user to enter the correct answer for a random multiplication which i've added to the post. However, my question is, I have an array of possible yes and no answers, yet how do I randomly generate those to the output terminal? My variables are:
String[] yList = { "Congratulations!", "Very well done", "A+", "Well done!"};
String[] nList = { "I'm sorry, the correct answer is ", "Not is not correct. The answer is: ", "Wrong. The answer is: "};
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
No problem, i've added them in but now it's telling me that "int index" has possible loss of precision, found: long, expected: int. I don't know what that means. I've tried creating int index just for the heck of it lol. Sorry for this, i'm sure it's a straight forward answer, but I'm still learning.
Business Accounts
Answer for Membership
by: Frosty555Posted on 2008-06-13 at 11:51:35ID: 21781722
Doesn't look too hard. You've already done all the hard work. Now you just need to get a random number based on the size of your yList and nList arrays, and display one of the indexes in the array.
Select allOpen in new window