A simple student management system written in Java [improved]

Source: Internet
Author: User

A simple student management system written in Java

import java.util.*;p Ublic class student_cj { public static void main ( String[] args) {    scanner in=new scanner (system.in);   System.out.print ("Please enter the number of students:");   int num=in.nextint ();//number of students   string[] str=new  string[num];//combined with one row of data   system.out.print ("Please enter the number of accounts:");   int kms=in.nextint ();//Number of accounts   string[] name=new string[num];//Student Name     int arr[][]=new  int[num][kms];//Store student Results   string[] kmmc= new string[kms];//subject name   int[]  sum=new int[num];//for Total   system.out.println ("Please set account name")   for (int i=0;i< kmmc.length;i++) {   system.out.print ("+ (i+1) +" subjects: ");    kmmc[i]=in.next ();   }    for (int i=0;i<num;i++) {   string cj= "";    system.out.print ("Please enter section" + (i+1) + "Student Name:");    name[i]=in.next ();       for (int j=0;j<kms ; j + +) {    system.out.print ("Please enter" +name[i]+ "" +kmmc[j]+ "Score:");     arr[i] [J]=in.nextint ();     cj+= "\ t" +arr[i][j];    sum[i]+=arr[i][j];    }   str[i]=name[i]+cj+ "\ t" +sum[i]+ "\ T" + (SUM[I]/KMS);  }    System.out.print ("name");   for (int i=0;i<kms;i++) {   system.out.print ("\ t" +kmmc [i]);   }  system.out.print ("\ T" + "total score" + "\ T" + "average");   for (int i=0;i<num;i++) {    system.out.println ();    system.out.print (Str[i]);  }   System.out.println ("\ n");   //the following to rank the score   system.out.print ("\t\t★★★ ranked the results ★");   System.out.println ();   system.out.print ("name");   for (int i=0;i<kms;i++) {    systeM.out.print ("\ T" +kmmc[i]),   }  system.out.print ("\ T" + "total score" + "\ T" + "average" + "\ T" + "leaderboard");   for (int i=0;i<num-1;i++) {   string tmp= "";    for (int j=0 ; j<num-1;j++) {    if (sum[i]<sum[i+1]) {     tmp=str[i];      str[i]=str[i+1];     str[i+1]=tmp;     }   }  }  system.out.println ();   for (int i=0;i<num; i++) {   system.out.print (str[i]+ "\ T" + "first" + (i+1) + "name");    system.out.println ();   } }}


A650) this.width=650; "title=" 1.png "src=" http://s3.51cto.com/wyfs02/M01/46/53/wKiom1Pxwn7izJIEAAMXAZTG618814.jpg "alt=" Wkiom1pxwn7izjieaamxaztg618814.jpg "/>

Related Article

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.