📄 exam.htm
字号:
<html><head><title>Java期末考试题</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><link rel="stylesheet" href="css/text.css" type="text/css"><script language="JavaScript"><!--function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features);}//--></script></head><script language="JavaScript">function getresultcheck(form){var mykeys=new Array();// mykeys[0]="B";mykeys[0]="D";//czp-select-answervar answer=new Array();for(var I=0;I<mykeys.length;I++) answer[I]="";var every=form.elements;<!--czp-select-count-->for(var I=0;I<every.length;I++){ if(every[I].type=="radio") { if(every[I].checked) { var item=parseInt(every[I].name.substr(0)); answer[item-1]+=every[I].value; } } }var newcount="<html><head><title>谢谢您!</title></head><body><center><h2><font color=red>您的测试结果</font></h2></center>";var totalscore=0;for(var I=0;I<answer.length;I++){ if(answer[I]==mykeys[I]) { var rstr="<font size=2>第"+(I+1)+"题答案正确!</font><br>"; newcount+=rstr; totalscore+=1/(answer.length)*100;//每题分数 }else { var rstr="<font size=2>第"+(I+1)+"题答案错误!正确答案为"+mykeys[I]+"</font><br>"; newcount+=rstr; }}newcount+="<br>您的总成绩为:";newcount+=Math.ceil(totalscore);newcount+="分";newwin=window.open("","","height=200,width=300,scrollbars=yes,resizable=no");newwin.document.write(newcount);}function getresultcheck1(form){var mykeys=new Array();// mykeys[0]="B";mykeys[0]="BD";mykeys[1]="ACD";mykeys[2]="AD";mykeys[3]="BCD";mykeys[4]="ACD";mykeys[5]="AC";mykeys[6]="AB";//czp-mulselect-answervar answer=new Array();for(var I=0;I<mykeys.length;I++) answer[I]="";var every=form.elements;<!--czp-mulselect-count-->for(var I=0;I<every.length;I++){ if(every[I].type=="checkbox") { if(every[I].checked) { var item=parseInt(every[I].name.substr(0)); answer[item-1]+=every[I].value; } } }var newcount="<html><head><title>谢谢您!</title></head><body><center><h2><font color=red>您的测试结果</font></h2></center>";var totalscore=0;for(var I=0;I<answer.length;I++){ if(answer[I]==mykeys[I]) { var rstr="<font size=2>第"+(I+1)+"题答案正确!</font><br>"; newcount+=rstr; totalscore+=1/(answer.length)*100;//每题分数 }else { var rstr="<font size=2>第"+(I+1)+"题答案错误!正确答案为"+mykeys[I]+"</font><br>"; newcount+=rstr; }}newcount+="<br>您的总成绩为:";newcount+=Math.ceil(totalscore);newcount+="分";newwin=window.open("","","height=200,width=300,scrollbars=yes,resizable=no");newwin.document.write(newcount);}function check(){var mykeys=new Array();//czp-tiankong-answer//mykeys[0]="B";var answer=new Array();for(var I=0;I<mykeys.length;I++) answer[I]="";var every=zfl.elements;for(var I=0;I<every.length;I++){if(every[I].type=="text"){ if(every[I].value!==null) { //var item=parseInt(every[I].name.substr(1))// answer[item-1]+=every[I].value; answer[I]+=every[I].value; } }}var newcount="<html><head><title>谢谢您!</title></head><body><center><h2><font face=\"隶书\" size=\"5\" color=\"#000099\">您的测试结果</font></h2></center>";var totalscore=0;for(var i=0;i<answer.length;i++){ if(answer[i]==mykeys[i]) { var rstr="<font face=\"宋体\" size=2>第"+(i+1)+"个空答案正确!</font><br>"; newcount+=rstr; totalscore+=1/(answer.length)*100; }else { var rstr="<font face=\"宋体\" size=2>第"+(i+1)+"个空答案错误!正确答案为"+mykeys[i]+"</font><br>"; newcount+=rstr; }}newcount+="<br><font face=\"宋体\" size=3><b>您的总成绩为:</b></font><font face=\"宋体\" size=3 color=red>";newcount+=Math.ceil(totalscore);newcount+="分</font><br>";newwin=window.open("","","height=400,width=400,scrollbars=yes,resizable=no");newwin.document.write(newcount);}</script><body bgcolor="#FFFFFF" text="#000000" topmargin=0><br><center> <table width="95%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class=text valign="top"> <form> <p><b>一、 选择</b><br> <br> 1、以下哪个不是线程的组成部分? <p><input type="radio" name="1" value="A"> A 处理器<p><input type="radio" name="1" value="B"> B 代码<p><input type="radio" name="1" value="C"> C 数据<p><input type="radio" name="1" value="D"> D 显示器<br><!--czp-select-timu--> </p> <p> <input type=button name=Button2 value=答案 交 onClick=MM_openBrWindow('text/examination/exam01_pop1.htm','','width=471,height=384') class=pbox> <input type="reset" name="Reset2" value="重置" class=pbox> <input type=button name=Button22 value="判分" onClick="getresultcheck(this.form)" class=pbox> </p> </form> <form> <p><b>二、多项选择</b><br> <br> 1、关于Applet,下面的哪几条是正确的? <p><input type="checkbox" name="1" value="A"> A Applet可以直接用java解释器执行<p><input type="checkbox" name="1" value="B"> B Applet可以在浏览器中执行<p><input type="checkbox" name="1" value="C"> C Applet就是一个Application,Application包含Applet<p><input type="checkbox" name="1" value="D"> D Applet也可以是一个Application<br> <br> 2、下面哪几个方法是Applet包含的? <p><input type="checkbox" name="2" value="A"> A start()<p><input type="checkbox" name="2" value="B"> B drawString(String s, int x, int y)<p><input type="checkbox" name="2" value="C"> C repaint()<p><input type="checkbox" name="2" value="D"> D destroy()<br> <br> 3、关于Applet的生命周期正确的说法有 <p><input type="checkbox" name="3" value="A"> A init方法在start方法之前执行<p><input type="checkbox" name="3" value="B"> B init方法在start方法之后执行<p><input type="checkbox" name="3" value="C"> C stop在Applet退出时被调用,只调用一次<p><input type="checkbox" name="3" value="D"> D stop在Applet 不可见时被调用,可以被调用多次<br> <br> 4、关于Runnable接口,正确的说法是 <p><input type="checkbox" name="4" value="A"> A 实现了Runnable接口就可以用start方法启动<p><input type="checkbox" name="4" value="B"> B Runable接口提供了通过线程执行程序的最基本的接口<p><input type="checkbox" name="4" value="C"> C Thread类实现了Runnable接口<p><input type="checkbox" name="4" value="D"> D Runnable只定义了一个run方法<br> <br> 5、下面说法正确的是 <p><input type="checkbox" name="5" value="A"> A Java中线程是抢占式的<p><input type="checkbox" name="5" value="B"> B Java中线程是分时的<p><input type="checkbox" name="5" value="C"> C Java中的线程可以共享数据<p><input type="checkbox" name="5" value="D"> D Java中的线程可以共享代码<br> <br> 6、下面属于Java线程同步方法的方法有 <p><input type="checkbox" name="6" value="A"> A join<p><input type="checkbox" name="6" value="B"> B run<p><input type="checkbox" name="6" value="C"> C wait<p><input type="checkbox" name="6" value="D"> D destroy<br> <br> 7、下面哪几个方法是过时的? <p><input type="checkbox" name="7" value="A"> A stop<p><input type="checkbox" name="7" value="B"> B resume<p><input type="checkbox" name="7" value="C"> C yield<p><input type="checkbox" name="7" value="D"> D start<br><!--czp-mulselect-timu--> </p> <p> <input type=button name=Button2 value=答案 交 onClick=MM_openBrWindow('text/examination/exam01_pop6.htm','','width=471,height=384') class=pbox> <input type="reset" name="Reset2" value="重置" class=pbox> <input type=button name=Button22 value="判分" onClick="getresultcheck1(this.form)" class=pbox> </p> </form> <form name="zfl"> </form> <form> <b>三、 编程题</b><br> <br> 1、 创建两个线程,每个线程打印出线程名字后再睡眠,给其它线程以执行的机会,主线程也要打印出线程名字后再睡眠,每个线程前后共睡眠5次。要求分别采用从Thread中继承和实现Runnable接口两种方式来实现程序。(即写两个程序)<br> <textarea name=jianda cols=50 rows=5></textarea> <br> <br> <br> 2、 编写三个线程分别显示各自的运行时间,第一个线程每隔1秒钟运行一次,第二个线程每隔5秒钟运行一次,第三个线程每隔10秒钟运行一次。如下图所示:<br> <img src="images/pic/6_1.jpg" width="401" height="78"> <br> <textarea name=jianda cols=50 rows=5></textarea> <br> <br> <!--czp-wenda-timu--> <br> <input type=button name=Button value=答案 案 onClick="MM_openBrWindow('text/examination/exam01_pop2.htm','','width=471,height=384')" class=pbox> <input type='reset' name='Submit3' value='重置' class=pbox> </form><form> </form> <form> </form> </td> </tr></table></center></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -