国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

java集合學生管理系統

2019-11-14 21:18:44
字體:
來源:轉載
供稿:網友
java集合學生管理系統
//student.javapackage com.sran.www;import java.util.Arrays;import java.util.Scanner;public class Student implements Comparable<Student>{int num;String name;int age;double[]s;double sum; //存儲學生的總分public Student(){s=new double[3];}public static boolean insert(){Scanner sc=new Scanner(System.in);String str=null;boolean be=true;do{Student stud=new Student();System.out.
//StudentTestpackage com.sran.www;import java.util.Scanner;import java.util.Set;import java.util.TreeSet;public class StudentTest {static Set<Student>set=null;  //定義集合,存儲學生信息public void fun(){int i;boolean b,bt;set=new TreeSet<Student>();  do{int flag=0;System.out.println("請輸入1,2,3,4,5   1代表錄入,2代表刪除,3代表查找,4代表顯示學生總成績排名,5代表更新某個學生數據");System.out.print("請輸入:");Scanner sc=new Scanner(System.in);int n=sc.nextInt();switch(n){case 1:{b=Student.insert(); if(b==true){System.out.println("正常結束錄入操作.....");}flag=1;break;}case 2:{b=Student.delete(); if(b==true){System.out.println("正常結束刪除操作.....");}flag=1;break;}case 3:{b=Student.seek();if(b==true){System.out.println("正常結束查詢操作.....");}flag=1;break;}case 4:{System.out.println("開始排名學生信息.....");System.out.println("學生按總成績排名:");for(Student stud:set){System.out.println(stud);System.out.println();}System.out.println("正常結束排名操作.....");flag=1;break;}case 5:{b=Student.update();if(b==true){System.out.println("正常結束更新操作.....");}flag=1;break;}}if(flag==0){System.out.println("你輸入有誤,請重新輸入");}System.out.println();do {bt=false;System.out.println("繼續所有學生信息操作,請輸入1    退出學生信息系統 ,請輸入0");System.out.print("請輸入:");i=sc.nextInt();if(i!=1 && i!=0){bt=true;System.out.println("輸入有誤,請重新輸入");}}while(bt==true);}while(i==1);System.out.println("你已退出學生信息系統.....");}public static void main(String[] args) {new StudentTest().fun();}}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 丰顺县| 津市市| 县级市| 台江县| 舟曲县| 社旗县| 大连市| 贵德县| 青河县| 休宁县| 兰西县| 洪湖市| 饶河县| 内黄县| 大庆市| 太保市| 汕头市| 霍城县| 高淳县| 贵阳市| 巴林右旗| 科尔| 偏关县| 汾西县| 尉氏县| 延安市| 喀喇| 子长县| 海口市| 定州市| 望都县| 济源市| 黑龙江省| 诸城市| 南平市| 成安县| 灵丘县| 库尔勒市| 富川| 边坝县| 岚皋县|