자바 학생 정보 관리 인터페이스 실현
주종
package         ;
 
public class Main {
 public static void main(String[] args) {
  // TODO          
  InterFace Menu=new InterFace();
  Menu.menu();
 }
}
package         ;
 
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.Scanner;
 
public class Add {
 static Stu[] stu=new Stu[100];
 static Scanner scanner=new Scanner(System.in);
 static  int number=0;
 static InterFace Inter=new InterFace();
 public void add() {
  while(true) {
   try {
    clear();
   } catch (AWTException e) {
    // TODO       catch  
    e.printStackTrace();
   }
   System.out.println("          :");
   int N=scanner.nextInt();
   for(int i=0;i<N;i++) {
    stu[number]=new Stu();
    System.out.println("    "+(i+1)+"      :");
    System.out.println("     :");
    stu[number].setNum(scanner.next());
    System.out.println("     :");
    stu[number].setName(scanner.next());
    System.out.println("     :");
    stu[number].setSex(scanner.next());
    System.out.println("     :");
    stu[number].setAge(scanner.nextInt());
    System.out.println("       :");
    stu[number].setChinese(scanner.nextFloat());
    System.out.println("       :");
    stu[number].setMath(scanner.nextFloat());
    System.out.println("       :");
    stu[number].setEng(scanner.nextFloat());
    number++;
   }
   System.out.println("    ,    !");
   Inter.menu();
  }
 }
 
 //       
 @SuppressWarnings("deprecation")
 public static void clear() throws AWTException
    {
        Robot r = new Robot();
        r.mousePress(InputEvent.BUTTON3_MASK);       //       
        r.mouseRelease(InputEvent.BUTTON3_MASK);    //       
        r.keyPress(KeyEvent.VK_CONTROL);             //   Ctrl 
        r.keyPress(KeyEvent.VK_R);                    //   R 
        r.keyRelease(KeyEvent.VK_R);                  //   R 
        r.keyRelease(KeyEvent.VK_CONTROL);            //   Ctrl 
        r.delay(100);       
    }
}
package         ;
 
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.*;
 
public class InterFace {
 static Scanner scanner=new Scanner(System.in);
 
 public void menu(){
  int select;
  try {
   clear();
  } catch (AWTException e) {
   // TODO       catch  
   e.printStackTrace();
  }
  do{
  System.out.println("\t\t                  
");
  System.out.println("\t\t ***  q □T■T□T■T□ TTr***
");  
  System.out.println("\t\t *    │                │  *
");  
  System.out.println("\t\t *    tTTT■T□T■T□T■s  *
");  
  System.out.println("\t\t *    ┌───────────┐    *
");  
  System.out.println("\t\t *    │1.      2.    │    *
");  
  System.out.println("\t\t *    │                      │    *
");  
  System.out.println("\t\t *    │3.      4.    │    *
");  
  System.out.println("\t\t *    │                      │    *
");  
  System.out.println("\t\t *    │5.      6.    │    *
");  
  System.out.println("\t\t *    │                      │    *
");  
  System.out.println("\t\t *    │7.      8.    │    *
");
  System.out.println("\t\t *    │                      │    *
");
  System.out.println("\t\t *    │9.      0.    │    *
");
  System.out.println("\t\t *    └───────────┘    *
");  
  System.out.println("\t\t ************************************
"); 
  System.out.println();
  System.out.println("\t       (1~8):
");
  select=scanner.nextInt();
  switch(select){
  case 8:
   
   break;
  case 5:
   
   break;
  case 4:
   
   break;
  case 3:
   
   break;
  case 2:
   
   break;
  case 9:
   
   break;
  case 7:
   Show show=new Show();
   show.show();
   break;
  case 1:
   Add operate=new Add();
   operate.add();
   break;
  case 0:
   
   break;
  default:
   try {
    clear();
   } catch (AWTException e) {
    // TODO       catch  
    e.printStackTrace();
   }
   this.menu();
  }
  }while(select!=8);
 }
 @SuppressWarnings("deprecation")
 public static void clear() throws AWTException
    {
        Robot r = new Robot();
        r.mousePress(InputEvent.BUTTON3_MASK);       //       
        r.mouseRelease(InputEvent.BUTTON3_MASK);    //       
        r.keyPress(KeyEvent.VK_CONTROL);             //   Ctrl 
        r.keyPress(KeyEvent.VK_R);                    //   R 
        r.keyRelease(KeyEvent.VK_R);                  //   R 
        r.keyRelease(KeyEvent.VK_CONTROL);            //   Ctrl 
        r.delay(100);       
    }
}
package         ;
 
import java.util.Scanner; 
 
public class Show {
 int n = Add.number;
 static Scanner scanner=new Scanner(System.in);
 public void show() {
  System.out.println("**********************************************************");
  System.out.println("                           ");
  for (int i = 0; i < n; i++)
   System.out.println(Add.stu[i].getNum() + " " +Add.stu[i].getName()+" "+ Add.stu[i].getSex() + " " + Add.stu[i].getAge() + " "
     + Add.stu[i].getChinese() + " " + Add.stu[i].getMath() + " " + Add.stu[i].getEng());
  System.out.println("**********************************************************");
  System.out.println();
  //n    
  try { Thread.sleep (100000) ; 
  } catch (InterruptedException ie){}
 }
}
package         ;
 
public class Stu {
 private String num;
 private String name;
 private String sex;
 private int age;
 private float chinese;
 private float math;
 private float eng;
 public String getNum() {
  return num;
 }
 public void setNum(String num) {
  this.num = num;
 }
 public String getName() {
  return name;
 }
 public void setName(String name) {
  this.name = name;
 }
 public String getSex() {
  return sex;
 }
 public void setSex(String sex) {
  this.sex = sex;
 }
 public int getAge() {
  return age;
 }
 public void setAge(int age) {
  this.age = age;
 }
 public float getChinese() {
  return chinese;
 }
 public void setChinese(float chinese) {
  this.chinese = chinese;
 }
 public float getMath() {
  return math;
 }
 public void setMath(float math) {
  this.math = math;
 }
 public float getEng() {
  return eng;
 }
 public void setEng(float eng) {
  this.eng = eng;
 }
}이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Is Eclipse IDE dying?In 2014 the Eclipse IDE is the leading development environment for Java with a market share of approximately 65%. but ac...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.