Student Management System

Source: Internet
Author: User

 Packagepractice;ImportJava.util.Scanner;ImportJavax.swing.JOptionPane; Public classATM1 { Public Static intXuehao[] =New int[10];  Public StaticString name[] =NewString[10];  Public Static intChengji[] =New int[10];  Public Static inti = 0;  Public Static voidMain (string[] args) {Joptionpane.showmessagedialog (NULL, "Welcome"); String Zhanghu= "123456"; String Mima= "123456"; BooleanISO =Denglu (Zhanghu, Mima); if(ISO) { while(true) {String b= Joptionpane.showinputdialog (NULL,                        "1, add \n2, display \n3, delete \n4, modify \n5, sort \n6, query \n7"); intA =Integer.parseint (b); Switch(a) { Case1: Tianjia ();  Break;  Case2: Xianshi ();  Break;  Case3: Shanchu ();  Break;  Case4: Xiugai ();  Break;  Case5: Paixu ();  Break;  Case6: Chaxu ();  Break;  Case7: System.exit (0);                    ;  Break; default: Joptionpane.showmessagedialog (NULL, "Input only 1-7"); }}}}//Query methodPrivate Static voidChaxu () {intCZ =Chazhao (); if(CZ! =-1) {Joptionpane.showmessagedialog (NULL, Xuehao[cz] +Name[cz]+Chengji[cz]); }}//Sorting MethodPrivate Static voidPaixu () { for(intn = 0; n < i; n++) {             for(intj = n + 1; J < I; J + +) {                if(Chengji[n] <Chengji[j]) {                    ints =Chengji[n]; Chengji[n]=Chengji[j]; CHENGJI[J]=s; String XM=Name[n]; Name[n]=Name[j]; NAME[J]=XM; intXH =Xuehao[n]; Xuehao[n]=Xuehao[j]; XUEHAO[J]=s;    }}} Xianshi (); }//Modify MethodPrivate Static voidXiugai () {intn =Chazhao (); if(n! =-1) {String str= Joptionpane.showinputdialog (NULL, "Please enter the modified number"); String str1= Joptionpane.showinputdialog (NULL, "Please enter a modified name"); String str2= Joptionpane.showinputdialog (NULL, "Please enter a modified score"); Xuehao[n]=integer.parseint (str); Name[n]=str1; Chengji[n]=Integer.parseint (STR2); }}//Delete MethodPrivate Static voidShanchu () {ints =Chazhao (); if(s! =-1) {             for(intn = s; n < i; n++) {Xuehao[n]= Xuehao[n + 1]; Name[n]= Name[n + 1]; Chengji[n]= Chengji[n + 1]; I--; }}}//Display methodPrivate Static voidXianshi () {String info= "";  for(intn = 0; n < i; n++) {Info+ = Xuehao[n] + name[n] + chengji[n] + "\ n"; } joptionpane.showmessagedialog (NULL, info); }//Add MethodPrivate Static voidTianjia () {String str= Joptionpane.showinputdialog (NULL, "Please enter the school number"); String str1= Joptionpane.showinputdialog (NULL, "Please enter your name"); String str2= Joptionpane.showinputdialog (NULL, "Please enter your score"); Xuehao[i]=integer.parseint (str); Name[i]=str1; Chengji[i]=Integer.parseint (STR2); I++; }//Landing Method Public Static BooleanDenglu (String Zhanghu, String mima) { for(intn = 3; n > 0; n--) {String str= Joptionpane.showinputdialog (NULL, "Please enter your account"); String str1= Joptionpane.showinputdialog (NULL, "Please enter your password"); if(Str.equals (STR1) &&str1.equals (STR1)) {                return true; }            if(n = = 1) {Joptionpane.showmessagedialog (NULL, "illegal input"); return false; } joptionpane.showmessagedialog (NULL, "Your input is wrong, please re-enter" + (n-1)); }        return false; }//Find Method Public Static intChazhao () {intindex =-1; String Str= Joptionpane.showinputdialog (NULL, "Please enter the person you want to find");  for(intn = 0; n < i; n++) {            if(Str.equals (Name[n])) {returnN; } joptionpane.showmessagedialog (NULL, "No this man."); }        return-1; }}

Student Management System

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.