皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
●试题七 【说明】 下面是一个Applet程序,其功能是根据给出的小时,分钟和秒数计算相等的秒数,即将1分钟化为60秒,依此类推。要求建立一个时间类,时间参数均作为类的成员变量,并且给出换算时间的方法,也作为这个类的成员函数,可以供外部对象进行调用。同时还需要在输出窗口中显示换算结果,并且将结果写到out3_3.txt文件中,本题给出确定的时间为4小时23分47秒,要求换算成以秒做单位的时间。 程序运行结果如图11所示。 图11 import javA.io.*; import javA.awt.*; import javA.applet.*; /* */ public class ex7_7 extends Applet{ public void paint(Graphics g){ int nSum; class myTime7_7{ public int h; public int m; public int s; public int out; public int caculateSecond(){ (1) ; return out; } } myTime7_7 objTime7_7 = new myTime7_7(); objTime7_7.h = 4; objTime7_7.m = 23; objTime7_7.s = 47; nSum = objTime7_7. (2) ; g.drawString ('时:'+objTime7_7.h, 20, 30); g.drawString ('分:'+objTime7_7.m, 20, 50); g.drawString ('秒:'+objTime7_7.s, 20, 70); g.drawString ( (3) ); try { FileOutputStream fos7_7 = new FileOutputStream('out7_7.txt'); BufferedOutputStream bos7_7=new BufferedOutputStream(fos7_7,1024); PrintStream ps7_7=new PrintStream(bos7_7,false); System.setOut(ps7_7); System.out.println( (4) ); ps7_7.close(); } catch(IOException ioe) { (5) (ioe); } } } ex7_7.html ex7_7
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】You look____,have we met before?
A.
familiar
B.
family
C.
faimilar
D.
faimillar
【单选题】You look _____ , have we met before?
A.
nice
B.
beautiful
C.
familiar
D.
cool
【单选题】在做水晶甲时,在上纸模时指模所起的作用是()
A.
装饰
B.
只起固定作用
C.
起延长支撑作用
【单选题】一Mary,you look confused.Have you made sense of the passage we are talking about? 一Yes,I another problem just now.
A.
have thought of
B.
was thinking of
C.
thought of
D.
had thought of
【简答题】Directions: Please complete the sentences with the words or expressions in the box. Make changes when necessary. portrait direct muscular bald recognize familiar ...
【单选题】You look ________. Have we met before?
A.
blonde
B.
bald
C.
familiar
D.
slim
E.
curly
F.
muscular
G.
overweight
【单选题】You look ____.Have we met before?
A.
familiar
B.
friend
C.
kind
【判断题】双关包含了语义双关和谐音双关。
A.
正确
B.
错误
【多选题】导游讲解的原则主要包括()。
A.
客观性原则
B.
针对性原则
C.
灵活性原则
D.
计划性原则
E.
鲜明性原则
【简答题】You look ________. Have we met before?
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题