ImageVerifierCode 换一换
格式:DOCX , 页数:14 ,大小:85.55KB ,
资源ID:15827405      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/15827405.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Java语言程序设计郑莉第七章课后习题答案Word下载.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

Java语言程序设计郑莉第七章课后习题答案Word下载.docx

1、重复以上过程,直到找到满足条件的记录,使查找成功,或直到子表不存在为止,此时查找不成功。5.声明一个类People,成员变量有姓名、出生日期、性别、身高、体重等;生成10个People类对象,并放在一个以为数组中,编写方法按身高进行排序。/People类public class People private String name; private String birthdaydate; private String sex; private double height; private double weight; public People()/默认构造函数 public People(

2、People p) this.name=p.name; this.birthdaydate=p.birthdaydate; this.sex=p.sex; this.height=p.height; this.weight=p.weight; public People(String name,String birthdaydate,String sex,double height,double weight) this.name=name; this.birthdaydate=birthdaydate; this.sex=sex; this.height=height; this.weigh

3、t=weight; public String getName() return name; public void setName(String name) this.name = name; public String getBirthdaydate() return birthdaydate; public void setBirthdaydate(String birthdaydate) this.birthdaydate = birthdaydate; public String getSex() return sex; public void setSex(String sex)

4、this.sex = sex; public double getHeight() return height; public void setHeight(double height) this.height = height; public double getWeight() return weight; public void setWeight(double weight) this.weight = weight; public String toString() return 姓名:+name+n出生年月:+birthdaydate+n性别:+sex+n身高:+height+n体

5、重:+weight;/test7_5类public class test7_5 /* * param args */ public static void main(String args) / TODO Auto-generated method stub People people= new People(林楚金,1989年8月13日男,182,63.5),诸葛亮181年7月23日,184,76.6),迈克杰克逊1958年8月29日,180,60),乔丹1963年2月17日,198,98.1),拿破仑1769年8月15日,159.5,63),苍井空1983年11月11日女,155,45),

6、; People temp=new People(); for(int i=0;ipeople.length-1;i+) for(int j=i+1;jpeople.length;j+) if(peoplei.getHeight()peoplej.getHeight() temp=peoplej; peoplej=peoplei; peoplei=temp; System.out.println(按身高从小到大排序后的结果如下:); System.out.println(peoplei+n运行结果:6.声明一个类,此类使用私有的ArrayList来存储对象。使用一个Class类的引用得到第一个

7、对象的类型之后,只允许用户插入这种类型的对象。/ Fuck类import java.util.ArrayList;public class Fuck private ArrayList man=new ArrayList(); private Class classType=null; public void add(Object f) if(man.size()=0) classType=f.getClass(); if(classType.equals(f.getClass() man.add(f);插入成功. else System.out.println(只允许插入+getClassT

8、ype()+类的对象. public ArrayList getMan() return man; public Class getClassType() return classType; public Fuck()/test7_6public class test7_6 Fuck fuckman=new Fuck(); String s=new String( fuckman.add(s); fuckman.add(10);/测试插入插入整数 fuckman.add(f/测试插入插入字符 fuckman.add(希特勒 System.out.println(fuckman.getMan()

9、;7.找出一个二维数组的鞍点,即该位置上的元素在所在行上最大,在所在列上最小。(也可能没有鞍点)/test7_7import java.util.Scanner;public class test7_7 public static void main(String args) int row, series, max; boolean T=false; Scanner cin = new Scanner(System.in);请输入数组的行数 row = cin.nextInt();请输入数组的列数 series = cin.nextInt(); int Array = new introws

10、eries; int R = new introw;/ 记录每行最大的数的列标 int S = new intseries;/ 记录每列最小的数的行标请输入数组内容 for (int i = 0; i Array.length; i+) for (int j = 0; j Arrayi.length; j+) Arrayij = cin.nextInt(); if(j=series-1) max = Arrayi0; for (int z = 1; z max) max = Arrayiz; Ri = z; Array0.length; max = Array0j; row ; if (Arrayzj max = Arrayzj; Sj = z;Array.length; if(SRi=i)鞍点:+Array+i+Ri+ :+ArrayiRi+ T=true; if(T=false)没有鞍点

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1