java - Random Test Generator with Classes -


i'm relatively new java , i'm trying develop test generator program in class called testgenerator, randomly selects 2 questions pool of 5 multiple choice questions in string array. i've been given hints create 1 dimensional array of 2 rows, within testgenerator class, randomly populated numbers 0 4 correspond questions array testbank. call array selectednumbers. whatever numbers selected, questions asked user. want questions asked separately through different windows , @ end tells me score. of have 5 5 string array, testbank, in first column question, next 3 answer choices, , fifth column correct answer.

public class testgenerator {     public static void main(string[] args) {  string testbank[][] = {{"what color grass?","a. green","b. red","c. pink","a"}, {"whats first month called?","a. december","b. january","c. march","b"}, {"what shape soccer ball?","a. square","b. flat","c. round","c"}, {"what flys?","a. birds","b. pigs","c. dogs","a"}, {"what planet on?","a. earth","b. venus","c. jupiter","a"}};   for(int = 0; < testbank.length; i++) { system.out.print(testbank[i][0]+" ");  for(int j = 1; j < testbank[i].length; j++) {  system.out.print(testbank[i][j]+" ");  } system.out.println(); } } } 

im having extreme difficulty in connecting randomly selected numbers array selectednumbers testbank , trouble getting questions output in different windows this:

input = joptionpane.showinputdialog("what color grass?\na. green\nb. red\nc. pink"); number = double.parsedouble(input); kitchen.setlength(number); 

it appreciated if me this. im new java please keep simple possible , explain me how figure out. thank you!


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -