欢迎来到天天文库
浏览记录
ID:58664949
大小:20.00 KB
页数:4页
时间:2020-10-15
《在线考试系统--简单java代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、OnlineExamQuestions()***************************************************************Index.javaimportjava.io.BufferedReader;importjava.io.InputStreamReader;publicclassIndex{staticintadminMenu(){intchoice=0;try{BufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));Syste
2、m.out.println("1.RegisterQustions");System.out.println("2.StartExam");System.out.println("3.Getout");choice=Integer.parseInt(br.readLine());}catch(Exceptione){System.out.println("Enteriserror");}returnchoice;}publicstaticvoidmain(String[]args){System.out.println("WelcometoOnlineExa
3、mSystem");intchoice;do{choice=adminMenu();switch(choice){case1:Questionsbr=newQuestions();br.QuestionList();break;case2:Questionstemp=newQuestions();temp.exam();break;}}while(choice!=3);System.out.println("ThankYou!!!");}}*******************************************************quest
4、ions.javaimportjava.io.BufferedReader;importjava.io.InputStreamReader;importjava.util.ArrayList;importjava.util.HashSet;importjava.util.Iterator;importjava.util.Random;publicclassQuestions{intquestionNumber;Stringquestion;StringoptionA;StringoptionB;StringoptionC;StringoptionD;Stri
5、ngcorrectOption;staticintQnumber;staticArrayLista1=newArrayList(10);booleanb=true;voidQuestionList(){try{BufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));System.out.println("EnterQuestionNumber:");this.questionNumber=Integer.parseInt(br.readLine());if(Qnumber!=0)
6、{for(inti=0;i7、A=br.readLine();System.out.println("EnterOption-B:");this.optionB=br.readLine();System.out.println("EnterOption-C:");this.optionC=br.readLine();System.out.println("EnterOption-D:");this.optionD=br.readLine();System.out.println("EntercorrectAnswer:");this.correctOption=br.readLine()8、;question();}}catch(Except
7、A=br.readLine();System.out.println("EnterOption-B:");this.optionB=br.readLine();System.out.println("EnterOption-C:");this.optionC=br.readLine();System.out.println("EnterOption-D:");this.optionD=br.readLine();System.out.println("EntercorrectAnswer:");this.correctOption=br.readLine()
8、;question();}}catch(Except
此文档下载收益归作者所有