create a random number in range 0-n
the use if/else if statements to test it: ==0 or ==1 or ==2 ... or ==n
Type: Posts; User: Norm
create a random number in range 0-n
the use if/else if statements to test it: ==0 or ==1 or ==2 ... or ==n
Can you use if/else if or switch statements? Generate an int in the range 0-n and use one of those statement to select the statements to execute.
If the questions were in an array, get a random index to get the question from the array.
What values are the instance variables given before their values are replaced with 6 and 0?
A problem I see is this compound expression: ((int)(Math.random())*12+6);
Needs to be separated into...
The posted code does not compile without errors. You need to fix the compiler errors in the posted code. I can not execute the code because of the errors.
If you are having problems fixing the...
Try Add some println() statements to print the values of all the variables used to compute the values so you can see what the statements are doing.
Use the Random class or the random method of...
Find where the toString() method gets the values it returns in the String.
Then look at where the variables used in the toString() method are given values.
Then look at the code that puts values in...
How are you trying to debug the code to find the problem? Try adding some println() statements that print the values of variables as they are set and used.