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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

本文(JAVA学生录取系统.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

JAVA学生录取系统.docx

1、JAVA学生录取系统要求:Java编程/* 编写程序实现如下功能:已知学生类变量(姓名、考号、综合成绩、体育成绩)和方法 (获取综合成绩、获取体育成绩、显示基本信息) ,学校类有变量(录取分数线)和方法(设置录取分数、获取录取分数线) ,录取类有方法(获取学生是否符合录取条件,其中录取条件为综合成绩在录取分数线之上,或体育成绩在 96 分以上并且综合成绩大于 300 分)。现要求编写程序输出一组学生对象中被某学校录取的学生基本信息。*/1.Schools 类import java.util.*;public class Schools private double scoreLine;/ 录取

2、分数线private String schoolName;/ 学校名称private int number;/ 入取人数public int getNumber() return number;public void setNumber(int number) doif(number0)this.number = number;break;elseSystem.out.println( 录取人数错误,请重输 );continue;while(true);Scanner sc=new Scanner(System.in);public String getSchoolName() return

3、schoolName;public void setSchoolName(String schoolName) this.schoolName = schoolName;public double getScoreLine() return scoreLine;public void setSchoolLine(double SchoolLine) public void setScoreLine(Schools schools) for(int i=0;i300)setSchoolLine(scoreLine1);elseSystem.out.println( 录取分数线错误,请重新输入 )

4、;i=i-1;continue;public Schools()2.Students 类import java.util.*;public class Students Scanner sc=new Scanner(System.in);private String name; / 姓名/ 考号private int ID;private double allScore;/ 综合成绩private double sportScore;/ 体育成绩private String firstHope;/ 第一志愿private String secondHope;/ 第二志愿public Strin

5、g getFirstHope() return firstHope;/ 确定第一志愿public void setFirstHope(String setFirstHope) this.firstHope=setFirstHope;public void setSecondHope(String setSecondHope)this.secondHope=setSecondHope;public void setFirstHope(Students student) doSystem.out.println( 请输入第一志愿 1.北京大学 ;2.南京大学 );int choice=Intege

6、r.parseInt(sc.nextLine();if(choice=1)student.setFirstHope( 北京大学 );break;else if(choice=2)student.setFirstHope( 南京大学 );break;elseSystem.out.println( 无此学校,请重输 );continue;while(true);public String getSecondHope() return secondHope;/ 确定第二志愿public void setSecondHope(Students student) doSystem.out.println

7、( 请输入第二志愿 1. 北京大学 ;2.南京大学 );int choice=Integer.parseInt(sc.nextLine();if(choice=1&!student.getFirstHope().equals( 北京大学 ) rvs13 。student.setSecondHope( 北京大学 );break;else if(choice=2&!student.getFirstHope().equals( 南京大学 ) E6ux6。student.setSecondHope( 南京大学 );break;elseSystem.out.println( 无此学校,或者与第一志愿重复

8、,请重输 ); continue;while(true);public String getName() return name;public void setName(String name) this.name = name;public int getID() return ID;public void setID(Students students) doSystem.out.println( 请输入学生考号 );int ID=Integer.parseInt(sc.nextLine();for(int i=0;i=0)setAllScore(allscore1);break;else

9、System.out.println( 综合成绩错误,请重新输入 );continue;while(true);public double getSportScore() return sportScore;public void setSportScore(double score) public void setSportScore() doSystem.out.println( 请输入体育成绩 );GAXJm。double sportscore1=Double.parseDouble(sc.nextLine();if(sportscore1=0)setSportScore(sportsc

10、ore1);break;elseSystem.out.println( 体育成绩错误,请重新输入 );continue;while(true);public void showInformation(Students student)System.out.println( 学 生 姓 名 为 : +student.getName()+ 学 生 考 号 为 : +student.getID()+ 综 合 成 绩 为 +student.getAllScore()+ 体 育 成 绩 为+student.getSportScore(); AuEPx。/ 构造器public Students(Strin

11、g name,int ID,double allScore,double sportScore) VpAbQ。this.name=name;this.ID=ID;this.allScore=allScore;this.sportScore=sportScore;public Students() / TODO Auto-generated constructor stub3.Enter 类(录取类)public class Enter Students student1=new Students();/ 判断录取public void enter(Students students,Schoo

12、ls schools) hANet。for(int i=0;i96)studentsi.setAllScore(0);for(int i=1;i=students.length-1;i+)for(int j=0;jstudentsj+1.getAllScore() 1mgCc。Students temp;temp=studentsj;studentsj=studentsj+1;studentsj+1=temp;int sum=0;int sum1=0;for(int i=0;istudents.length;i+)学VKwGGif(studentsi.getFirstHope().equals

13、( 北 京 大)&sumschools0.getScoreLine()sum=sum+1;System.out.println( 恭喜被北大录取 );student1.showInformation(studentsi);else if(studentsi.getFirstHope().equals( 南 京 大 学)&sum1schools1.getScoreLine() 5F9Lm。sum1=sum1+1;System.out.println( 恭喜被南京大学录取 );student1.showInformation(studentsi);else if(sumschools0.getNu

14、mber()&studentsi.getSecondHope().equals( 南京 大学 )&studentsi.getAllScore()schools1.getScoreLine() nSzPZ。sum1=sum1+1;System.out.println( 恭喜被南京大学录取 );student1.showInformation(studentsi);else if(sum1schools1.getNumber()&studentsi.getSecondHope().equals( 北 京大学 )&studentsi.getAllScore()schools0.getScoreLin

15、e() tOvms。sum=sum+1;System.out.println( 恭喜被北大录取 );student1.showInformation(studentsi);else if(sumschools0.getNumber()&sum1schools1.getNumber() UwyuE。System.out.println( 学校人数已满无法录取 );break;4.Demo 类(操作类)import java.util.*;public class Demo Scanner sc=new Scanner(System.in);Students students;Schools sc

16、hools=new Schools2 ;Schools school=new Schools();Enter en=new Enter();/ 确定两所大学分数线public void main()schools0=new Schools();schools0.setSchoolName( 北京大学 );System.out.println( 请输入北京大学录取人数 );int num1=Integer.parseInt(sc.nextLine(); schools0.setNumber(num1);schools1=new Schools();schools1.setSchoolName(

17、南京大学 );System.out.println( 请输入南京大学录取人数 );int num2=Integer.parseInt(sc.nextLine(); schools1.setNumber(num2); school.setScoreLine(schools);/ 输入学生信息 doSystem.out.println( 请输入学生位数 );int num=Integer.parseInt(sc.nextLine();if(num0)students=new Studentsnum;for(int i=0;istudents.length;i+)studentsi=new Stud

18、ents();System.out.println( 请输入学生姓名 );String name=sc.nextLine();studentsi.setName(name); studentsi.setID(students); studentsi.setAllScore(); studentsi.setSportScore(); studentsi.setFirstHope(studentsi); studentsi.setSecondHope(studentsi);/break;elseSystem.out.println( 学生个数错误,请重输 );continue;while(true);en.enter(students,schools);public static void main(String args) / TODO Auto-generated method stubDemo de = new Demo();de.main();

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

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