Dieser Artikel teilt mit Ihnen die Java -Implementierung des Student Score -Eintragssystems für Ihre Referenz. Der spezifische Inhalt ist wie folgt
1. Studentenkategorie, einschließlich des Namens und der Noten des Schülers jedes Faches
public class Score {public String Name; Public Double Englishgrade, Mathegrade, Phyicalgrade, Chemicalgrade, Biologicalgrade; Score () {} public Score (String -Name, Double Englishgrade, Double Mathgrade, Double Physical Grad, Double Chemicalgrade, Double Biologicalgrade) {this.name = name; this.Englishgrade = englischArad; this.mathgrade = mathgrad; this.phyicalgrade = Physicalgrade; this.chemicalgrade = chemicalgrade; this.biologicalgrade = biologicalgrade; }}2. Richten Sie die Schülerklasse ein, einschließlich Einstellung und Suche usw. usw.
Paketbewertung; public class Scorezip {Score [] S = New Score [5]; public void setData (Bewertungsname, int Index) {// Notenklasse hinzufügen, um Array s [index] = name; } public Score [] getData () {// Rückgabe des Studentenarrays return s; } public Score serchdata (String -Name) {// Die Student -Scores für (int index = 0; index <sength; index ++) {if (name! = null && s [index]! }} return null; }}3..
Paketbewertung; import Java.util.scanner; public class Scorezip2 {public static void main (String [] arr) {Scanner sc = neuer Scanner (System.in); Scorezip SR = neuer Scorezip (); für (int i = 0; i <5; i ++) {// Die Student Score -Tabelle mit Länge fünf wird hier definiert system.out.println ("Schülername eingeben:"); String name = sc.Next (); if (name.equals ("n")) {break; } System.out.println ("English Score:"); double englisch = sc.nextDouble (); System.out.println ("Mathematische Punktzahl:"); double math = sc.nextDouble (); System.out.println ("Physische Punktzahl:"); double physisch = sc.nextDouble (); System.out.println ("Chemische Punktzahl:"); double chemical = sc.nextDouble (); System.out.println ("Bioto -Score:"); double biology = sc.nextDouble (); Score S = neue Punktzahl (Name, Englisch, Mathematik, physikalische, chemische, Biologie); Sr.setData (s, i); } System.out.println("================================================================================================= =======================================================ieben =======================================================ieben ================================================================================ =======================================================ieben =======================================================ieben =======================================================ieben System.out.println ("name/t/Teglish Score/t/tmathematics Score/T/T Physics Score/T/TChemical Score/T/T Biologie Score"); S. englishgrad+"/t/t"+smathgrade+"/t/t"+S. Phyicalgrade+"/t/t"+schemicalgrade+"/t/t"+s.biologicalgrade); Der zu suchen: "); String name = sc.Next (); Score S = sr.serchdata (Name); if (s == null) {System.out.println (" sorry, es gibt keinen Schülernamen ");} else {double mg = smathgrade; double Eglishgrade; double bg = double pg = S.PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S. PG = S., double pg. S.BiologicalGera; IS: " + subine);}}}}Ergebnisse:
Das obige ist der gesamte Inhalt dieses Artikels. Ich hoffe, es wird für das Lernen aller hilfreich sein und ich hoffe, jeder wird Wulin.com mehr unterstützen.