Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 A Simple Problem?
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rahman200012




PostPosted: Tue Jan 22, 2008 5:23 pm   Post subject: A Simple Problem?

I am supposed to develop a tic tac toe game with trivia questions using:

- Version 1.7 READY to program with Java
- Limited knowledge of Arrays and Methods

I have stored my questions using 'case'. However I need to draw my 50 randomized questions with my tic tac toe board. For example:

"What is the capital of Canada?"
- Ottawa

You are correct.
Please place either 'x' or an 'o'.

I also need to test whether the user has gotten the answer to the question right or wrong.
Any hep is greatly appreciated.
Sponsor
Sponsor
Sponsor
sponsor
rahman200012




PostPosted: Tue Jan 22, 2008 5:45 pm   Post subject: Re: A Simple Problem?

[bump]
HeavenAgain




PostPosted: Tue Jan 22, 2008 6:08 pm   Post subject: RE:A Simple Problem?

put the correct answers to another "answer" array, and compare the input with their input (ignore case if you have to)
and for selecting random question, you can make a random class, and just get random numbers from there
code:
import java.util.Random;
class Test
{
 public static void main(String[] args)
 {
   Random random = new Random();
   System.out.println(random.nextInt(50));
  }
}
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: