import java.io.*; import java.lang.*; import java.util.Random; import java.math.*; public class first{ public static void main(String args[])throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Mathematical Operations Drill"); System.out.println("1.Practice"); System.out.println("2.Challenge"); System.out.println(); System.out.println("Enter choice:"); int choice=Integer.parseInt(br.readLine()); System.out.println("Number of items:"); int items=Integer.parseInt(br.readLine()); generator.rangen(items); } public static class generator extends first{ public static void rangen(int items){ Random rand = new Random(); for(int counter=1; counter<items;counter++) { int x=1+rand.nextInt(100); int y=1+rand.nextInt(100); int z=1+rand.nextInt(4); switch(z){ case 1:System.out.println(+x+"+"+y+"=");break; case 2:System.out.println(+x+"-"+y+"=");break; case 3:System.out.println(+x+"*"+y+"=");break; case 4:System.out.println(+x+"/"+y+"=");break; } } } } }
How can I store the user's answers into an array? pls help.