/** * Write a description of class state here. * * @author (your name) * @version (a version number or a date) */ import java.util.*; import java.io.*; import java.util.Scanner; public class state { public static Void main(String[]args) throws FileNotFoundException { Scanner input = new Scanner (System.in); String s =" "; String[] data, category, option,option2,option3,option4; data =new String [50]; category = new String[50]; option = new String [50]; option2 = new String [50]; option3 = new String [50]; option4 = new String [50]; int [] choice, answer; choice = new int[50]; answer = new int[50]; System.out.printf(" Welcome to Quiz Creator",s); System.out.printf("What to do?",s); System.out.printf("1]Specify number of question you want to do"); System.out.printf("2]Enter the question CATEGORY"); System.out.printf("3]Enter the QUESTION for each category"); System.out.printf("4]Enter the OPTION for each question"); System.out.printf("5]Provide the ANSWER for each question"); System.out.printf("6]Then your QUIZ GAME is ready to be play by your friend"); System.out.printf("Press any key to start the game.."); System.out.println(); input.nextLine(); System.out.println("How many question you want to create:"); choice[1]=input.nextInt(); System.out.println(); System.out.print('\u000C'); input.nextLine(); System.out.println("Please enter your question CATEGORY"); for (int a=0; a<choice[1];a++){ System.out.print(choice[2]+1+"] "); data[a]=input.nextLine(); choice[2]=choice [2] + 1; } System.out.print('\u000C'); System.out.println(); System.out.println("Please enter your Question"); for (int b=0; b<choice[1];b++){ System.out.println(); System.out.println(" Category: " + data[b]); System.out.printf(choice[3] + 1 +" ] "); category[b]=input.nextLine(); choice[3]=choice[3]+ 1; } System.out.print('\u000C'); System.out.println(); System.out.println("Please enter your question option "); for (int c=0; c<choice[1];c++) { System.out.println(); System.out.println("question : " + category [c]); System.out.println(); System.out.printf("1]"); option[c] = input.nextLine(); System.out.printf("2]"); option2[c] = input.nextLine(); System.out.printf("3]"); option3[c] = input.nextLine(); System.out.printf("4]"); option4[c] = input.nextLine(); System.out.println(); System.out.println("please set the answerto this question"); System.out.print("the answer is "); answer[c]= input.nextInt(); input.nextLine(); System.out.println(); } System.out.println("your quiz game is now ready...press the enter to start "); input.nextLine(); System.out.print('\u000C'); System.out.printf(" welcome to game quiz"); System.out.printf("Game rule; 1] select 1 topic"); System.out.printf("2] answer the mcq question"); System.out.printf("3] each correct answer will given 10 point"); System.out.printf("4] each incorrect answer will be deducted 10 point"); System.out.printf("5] the game will be over once your answer the question wrongly"); System.out.println(); System.out.printf(" press the enter key to start the game..."); input.nextLine(); System.out.print('\u000C'); } }