首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
[说明] 下面是一段java代码,运行结果如图11-8所示。 程序代码如下: (1)Java.awt.Graphics; (2)Java.applet.Applet; // ////////////////////////
[说明] 下面是一段java代码,运行结果如图11-8所示。 程序代码如下: (1)Java.awt.Graphics; (2)Java.applet.Applet; // ////////////////////////
admin
2010-01-29
40
问题
[说明] 下面是一段java代码,运行结果如图11-8所示。
程序代码如下:
(1)Java.awt.Graphics;
(2)Java.applet.Applet;
// ////////////////////////////////////////////
// Display y=sin(x)
public class J_DrawSin (2) Applet
{
public void paint(Graphics g)
{
double d, tx;
int x, y, x0, y0;
d=Math.PI/100; // Set step(Set the unit in x direction)
x0=y0=0;
(3)(tx=0, x=20; tx<2*Math.PI; tx+=d,x++)
{
y=120-(int)(Math.sin(tx)*50+60);
if(x>20)
g.drawLine(x0, y0, x, y);
x0=x;
y0=y;
}
g.drawstring("y=sin(x)", 10, 70);
} //End of method: paint
} //End of class: J_HelloApplet
<!-----------------------AppletExample.html------------------->
<HTML>
<HEAD>
<TITLE>
An applet Example ---- Hello Applet!
</TITLE>
</HEAD>
<BODY>
<(4)CODE="J_DrawSin.class" WIDTH=300 HEIGHT=120>
</APPLET>
</BODY>
</HTML>
选项
答案
(1)import (2)extends (3)for (4)APPLET。
解析
转载请注明原文地址:https://kaotiyun.com/show/SwCZ777K
本试题收录于:
电子商务技术员上午基础知识考试题库软考初级分类
0
电子商务技术员上午基础知识考试
软考初级
相关试题推荐
一个局域网中某台主机的IP地址为176.68.160.12,使用22位作为网络地址,那么该局域网的子网掩码为(61),最多可以连接的主机数为(62)。
已知3个类O、P和Q,类O中定义了一个私有方法F1和一个公有方法F2;类P中定义了一个公有方法F3,类P为类O的派生类;类Q为类P的派生类,它们的继承方式如下所示:classP:publicO{…};classQ:privateP{
在一个单CPU的计算机系统中,有两台外部设备R1、R2和三个进程P1、P2、P3。系统采用可剥夺式优先级的进程调度方案,且所有进程可以并行使用I/O设备,三个进程的优先级、使用设备的先后顺序和占用设备时间如下表所示:假设操作系统的开销忽略不计,三个进程
在活动图中,结点表示项日中各个工作阶段的里程碑,连接各个结点的边表示活动,边上的数字表示活动持续的时间。在下面的活动图中,从A到J的关键路径是(16),关键路径的长度是(17),从E开始的活动启动的最早时间是(18)。
设求解某问题的递归算法如下:F(intn){if(n=-=1){Move(1);}else{F(n-1);Move(n);
请根据下面叙述的场景选用适当的设计模式。若某面向对象系统中的某些类有且只有一个实例,那么采用(42)设计模式能够有效达到该目的;该系统中的某子模块需要为其他模块提供访问不同数据库系统(Oracle、SQLServer、DB2UDB等)的功能,这些数据库系统
请根据下面叙述的场景选用适当的设计模式。若某面向对象系统中的某些类有且只有一个实例,那么采用(42)设计模式能够有效达到该目的;该系统中的某子模块需要为其他模块提供访问不同数据库系统(Oracle、SQLServer、DB2UDB等)的功能,这些数据库系统
在进行金融业务系统的网络设计时,应该优先考虑(69)原则。在进行企业网络的需求分析时,应该首先进行(70)。
阅读以下关于网页制作和网页编程的说明,回答问题1至问题4。*
阅读以下关于网页制作和网页编程的说明,回答问题1至问题4。*
随机试题
"Shallwego?""No,______."
不能及时检验的尿标本需保存于
义齿稳定的设计原则包括
各种排风系统排风口风帽的选择,不宜采用_______。
矿业工程技术档案的内容包括()。
按热力管道系统形式来分,直接消耗一次热媒,中间设备少,但一次补充量大的是()系统。
工作的搭接顺序关系是用前项工作的开始或完成时间与其紧后工作时间的开始或完成时间之间的间距来表示,具体有四类,分别是()。
郑兵的孩子即将上高中,郑兵发现,在当地中学,学生与老师的比例低的学校,学生的高考成绩普遍都比较好,郑兵因此决定,让他的孩子选择学生总人数最少的学校就读。以下哪项最为恰当地指出了郑兵上述决定的漏洞?()
在恐龙灭绝6500万年后的今天,地球正面临着又一次物种大规模灭绝的危机。截止到上个世纪末,全球大约有20%的物种灭绝。现在,大熊猫、西伯利亚虎、北美玳瑁、巴西红木等许多珍稀物种面临着灭绝的危险。有三位学者对此作了预测。学者一:如果大熊猫灭绝,则西伯利亚虎
A、 B、 C、 D、 C
最新回复
(
0
)