已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
济宁学院计算机科学系Java程序设计期末考试C参考答案及评分标准一、单项选择题(本大题共15,每小题2分,共30分)在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在题后的括号内。错选、多选或未选均无分。12345678910BBDACCCACC1112131415BAABC二、填空1、编辑源程序、编译生成字节码、解释运行字节码2、Applet、MyApplet3、javac.exe、3、 . class4、2 、25、06、true 、 false7、抽象(abstract)方法、最终(final)方法8、package MyPackage ; 应该在程序第一句。 9、static double additoryFee = 0.1;10、单、多11、6三、程序结果(每空4分,共20分)1、s=50502、Hello! I love JAVA.3、s = 1804、a=60 b=20 c=305、11 31 41 61 71四.编程题(共两大题,每小题10分,共20分)1、参考程序如下:public class Sum public static void main( String args ) double sum = 0.0 ; for ( int i = 1 ; i = 100 ; i + + ) sum += 1.0/(double) i ; System.out.println( sum=+sum ); 2、参考程序如下:class Linght Private int watts; Private Boolean indicator; Linght(int watts)this.watts=watts; Light(int watts,Boolean indicator)this.watts=watts;this.indicator=indicator; public void switchOn()this.indicator=true; public void switchOff()this.indicator=false; pulic void printInfo() System.out.println(“watts=”+watts); System.out.println(“indicator =”+ indicator);Class TubeLight extends Light private int tubLength; private String; TubeLight(int watts,int tubeLigth,String color) super(watts); this.tubeLigth= tubeLigth; this.color=color; public void printinfo() super.printinfo();System.out.println(“tubeLight=”+ tubeLight); System.out.println(“color=”+ color); Class Test public static void main(String arg) TubeLight t1=new TubeLight(32,50,”白色”); T1.switchOn(); T1. printinfo();3 class PersonString name;char sex;int age;public Person(String name,char sex,int age)=name;this.sex=sex;this.age=age;class Student extends PersonString no;String enter;String major;public Student(String name;char sex;int age,String no,String enter,String major)super(name,sex,age);this.no=no;this.enter=enter;this.major=major;public String toString()return name+”,”+sex+”,”+age+”,”+no+”,”+enter+”,”+major;Class Teachar extends PersonString pro;String department;Public Teacher(String name,char sex,int age,String pro,String department)Super(name,sex,age);T=pro;This.department=department;Public String toString()Return name+”,”+sex+”,”+age+”,”+pro+”,”+department;Public class testPublic static void main(String args)Student no1=new Student(“no1”,w,20,”001”,”2009/9/12”,”computer”);
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年一级注册建筑师之建筑经济、施工与设计业务管理考试题库300道附答案【典型题】
- 2026年一级注册建筑师之建筑物理与建筑设备考试题库300道附完整答案【夺冠】
- 2026年企业社群营销方案设计与用户裂变增长指南
- 2025江西吉安青原区审计局选调事业单位人员2人备考题库附答案
- 2026年试验检测师之交通工程考试题库300道附参考答案【轻巧夺冠】
- 2026年初级银行从业资格之初级公司信贷考试题库300道带答案(黄金题型)
- 2026年一级注册建筑师之建筑物理与建筑设备考试题库300道带答案(考试直接用)
- 2026年一级注册建筑师之建筑物理与建筑设备考试题库300道含完整答案(夺冠系列)
- 2026年一级注册建筑师之建筑物理与建筑设备考试题库300道附参考答案(夺分金卷)
- 2025湖北宜昌市建筑节能推广中心编外聘用人员招聘1人参考题库附答案
- 《设备买卖合同模板》
- 《化妆品原料》课件-其他油脂
- 血透室应急预案(完整版)
- 工程欠款起诉书范本
- 体育学院运动康复与健康专业教学计划
- 消防应急疏散和灭火演习技能培训
- 流产诊断证明书
- 2023年广告制作验收报告(5篇)
- GA 1814.3-2023铁路系统反恐怖防范要求第3部分:运营线路
- 食品营养学(暨南大学)智慧树知到答案章节测试2023年
- 辽宁省大连市2021-2022学年高一上学期期末化学试题Word版含答案
评论
0/150
提交评论