java報考系統代碼 java程序員考試報名網址

學生考試管理系統,JAva源代碼

//主類EnglishTest——

創新互聯堅持“要么做到,要么別承諾”的工作理念,服務領域包括:成都做網站、網站設計、企業官網、英文網站、手機端網站、網站推廣等服務,滿足客戶于互聯網時代的龍井網站設計、移動媒體設計的需求,幫助企業找到有效的互聯網解決方案。努力成為您成熟可靠的網絡建設合作伙伴!

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

public class EnglishTest extends JFrame

{

TestArea testPanel=null;

Container con=null;

public EnglishTest()

{

super("模擬考試");

testPanel=new TestArea();

con=getContentPane();

con.add(testPanel,BorderLayout.CENTER);

addWindowListener(new WindowAdapter()

{ public void windowClosing(WindowEvent e)

{ System.exit(0);

}

});

setVisible(true);

setBounds(60,40,660,460);

con.validate();

validate();

}

public static void main(String args[])

{

new EnglishTest();

}

}

//讀取試題 ReadTestquestion

import java.io.*;

import java.util.*;

public class ReadTestquestion

{ String filename="",

correctAnswer="",

testContent="" ,

selection="" ;

int score=0;

long time=0;

boolean 完成考試=false;

File f=null;

FileReader in=null;

BufferedReader 讀取=null;

public void setFilename(String name)

{ filename=name;

score=0;

selection="";

try {

if(in!=null讀取!=null)

{

in.close();

讀取.close();

}

f=new File(filename);

in=new FileReader(f);

讀取=new BufferedReader(in);

correctAnswer=(讀取.readLine()).trim();

String temp=(讀取.readLine()).trim() ;

StringTokenizer token=new StringTokenizer(temp,":");

int hour=Integer.parseInt(token.nextToken()) ;

int minute=Integer.parseInt(token.nextToken());

int second=Integer.parseInt(token.nextToken());

time=1000*(second+minute*60+hour*60*60);

}

catch(Exception e)

{

testContent="沒有選擇試題";

}

}

public String getFilename()

{

return filename;

}

public long getTime()

{

return time;

}

public void set完成考試(boolean b)

{

完成考試=b;

}

public boolean get完成考試()

{

return 完成考試;

}

public String getTestContent()

{ try {

String s=null;

StringBuffer temp=new StringBuffer();

if(讀取!=null)

{

while((s=讀取.readLine())!=null)

{

if(s.startsWith("**"))

break;

temp.append("\n"+s);

if(s.startsWith("endend"))

{

in.close();

讀取.close();

完成考試=true;

}

}

testContent=new String(temp);

}

else

{

testContent=new String("沒有選擇試題");

}

}

catch(Exception e)

{

testContent="試題內容為空,考試結束!!";

}

return testContent;

}

public void setSelection(String s)

{

selection=selection+s;

}

public int getScore()

{ score=0;

int length1=selection.length();

int length2=correctAnswer.length();

int min=Math.min(length1,length2);

for(int i=0;imin;i++)

{ try{

if(selection.charAt(i)==correctAnswer.charAt(i))

score++;

}

catch(StringIndexOutOfBoundsException e)

{

i=0;

}

}

return score;

}20:10 03-8-31

public String getMessages()

{

int length1=selection.length();

int length2=correctAnswer.length();

int length=Math.min(length1,length2);

String message="正確答案:"+correctAnswer.substring(0,length)+"\n"+

"你的回答:"+selection+"\n";

return message;

}

}

//考試區域TestArea

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.io.*;

class FileName implements FilenameFilter

{

String str=null;

FileName (String s)

{

str="."+s;

}

public boolean accept(File dir,String name)

{

return name.endsWith(str);

}

}

public class TestArea extends JPanel implements ActionListener,ItemListener,Runnable

{

Choice list=null;

JTextArea 試題顯示區=null,消息區=null;

JCheckBox box[];

JButton 提交該題答案,讀取下一題,查看分數;

ReadTestquestion 讀取試題=null;

JLabel welcomeLabel=null;

Thread countTime=null;

long time=0;

JTextField timeShow=null;

boolean 是否關閉計時器=false,

是否暫停計時=false;

JButton 暫停或繼續計時=null;

public TestArea()

{

list= new Choice();

String 當前目錄=System.getProperty("user.dir");

File dir=new File(當前目錄);

FileName fileTxt=new FileName("txt");

String fileName[]=dir.list(fileTxt);

for(int i=0;ifileName.length;i++)

{

list.add(fileName[i]);

}

試題顯示區=new JTextArea(15,12);

試題顯示區.setLineWrap(true);

試題顯示區.setWrapStyleWord(true);

試題顯示區.setFont(new Font("TimesRoman",Font.PLAIN,14));

試題顯示區.setForeground(Color.blue);

消息區=new JTextArea(8,8);

消息區.setForeground(Color.blue);

消息區.setLineWrap(true);

消息區.setWrapStyleWord(true);

countTime=new Thread(this);

String s[]={"A","B","C","D"};

box=new JCheckBox[4];

for(int i=0;i4;i++)

{

box[i]=new JCheckBox(s[i]);

}

暫停或繼續計時=new JButton("暫停計時");

暫停或繼續計時.addActionListener(this);

提交該題答案=new JButton("提交該題答案");

讀取下一題=new JButton("讀取第一題");

讀取下一題.setForeground(Color.blue);

提交該題答案.setForeground(Color.blue);

查看分數=new JButton("查看分數");

查看分數.setForeground(Color.blue);

提交該題答案.setEnabled(false);

提交該題答案.addActionListener(this);

讀取下一題.addActionListener(this);

查看分數.addActionListener(this);

list.addItemListener(this);

讀取試題=new ReadTestquestion();

JPanel pAddbox=new JPanel();

for(int i=0;i4;i++)

{

pAddbox.add(box[i]);

}

Box boxH1=Box.createVerticalBox(),

boxH2=Box.createVerticalBox(),

baseBox=Box.createHorizontalBox();

boxH1.add(new JLabel("選擇試題文件"));

boxH1.add(list);

boxH1.add(new JScrollPane(消息區));

boxH1.add(查看分數);

timeShow=new JTextField(20);

timeShow.setHorizontalAlignment(SwingConstants.RIGHT);

timeShow.setEditable(false);

JPanel p1=new JPanel();

p1.add(new JLabel("剩余時間:"));

p1.add(timeShow);

p1.add(暫停或繼續計時);

boxH1.add(p1);

boxH2.add(new JLabel("試題內容:"));

boxH2.add(new JScrollPane(試題顯示區));

JPanel p2=new JPanel();

p2.add(pAddbox);

p2.add(提交該題答案);

p2.add(讀取下一題);

boxH2.add(p2);

baseBox.add(boxH1);

baseBox.add(boxH2);

setLayout(new BorderLayout());

add(baseBox,BorderLayout.CENTER);

welcomeLabel=new JLabel("歡迎考試,提高英語水平",JLabel.CENTER);

welcomeLabel.setFont(new Font("隸書",Font.PLAIN,24));

welcomeLabel.setForeground(Color.blue);

add(welcomeLabel,BorderLayout.NORTH);

}

public void itemStateChanged(ItemEvent e)

{

timeShow.setText(null);

是否關閉計時器=false;

是否暫停計時=false;

暫停或繼續計時.setText("暫停計時");

String name=(String)list.getSelectedItem();

讀取試題.setFilename(name);

讀取試題.set完成考試(false);

time=讀取試題.getTime();

if(countTime.isAlive())

{

是否關閉計時器=true;

countTime.interrupt();

}

countTime=new Thread(this);

消息區.setText(null);

試題顯示區.setText(null);

讀取下一題.setText("讀取第一題");

提交該題答案.setEnabled(false);

讀取下一題.setEnabled(true);

welcomeLabel.setText("歡迎考試,你選擇的試題:"+讀取試題.getFilename());

}

public void actionPerformed(ActionEvent e)

{

if(e.getSource()==讀取下一題)

{

讀取下一題.setText("讀取下一題");

提交該題答案.setEnabled(true);

String contentTest=讀取試題.getTestContent();

試題顯示區.setText(contentTest);

消息區.setText(null);

讀取下一題.setEnabled(false);

try {

countTime.start();

}

catch(Exception event)

{

}

}

if(e.getSource()==提交該題答案)

{

讀取下一題.setEnabled(true);

提交該題答案.setEnabled(false);

String answer="?";

for(int i=0;i4;i++)

{

if(box[i].isSelected())

{

answer=box[i].getText();

box[i].setSelected(false);

break;

}

}

讀取試題.setSelection(answer);

}

if(e.getSource()==查看分數)

{

int score=讀取試題.getScore();

String messages=讀取試題.getMessages();

消息區.setText("分數:"+score+"\n"+messages);

}

if(e.getSource()==暫停或繼續計時)

{

if(是否暫停計時==false)

{

暫停或繼續計時.setText("繼續計時");

是否暫停計時=true;

}

else if(是否暫停計時==true)

{

暫停或繼續計時.setText("暫停計時");

是否暫停計時=false;

countTime.interrupt();

}

}

}

public synchronized void run()

{

while(true)

{

if(time=0)

{

是否關閉計時器=true;

countTime.interrupt();

提交該題答案.setEnabled(false);

讀取下一題.setEnabled(false);

timeShow.setText("用時盡,考試結束");

}

else if(讀取試題.get完成考試())

{

是否關閉計時器=true;

timeShow.setText("考試效果:分數*剩余時間(秒)="+1.0*讀取試題.getScore()*(time/1000));

countTime.interrupt();

提交該題答案.setEnabled(false);

讀取下一題.setEnabled(false);

}

else if(time=1)

{

time=time-1000;

long leftTime=time/1000;

long leftHour=leftTime/3600;

long leftMinute=(leftTime-leftHour*3600)/60;

long leftSecond=leftTime%60;

timeShow.setText(""+leftHour+"小時"+leftMinute+"分"+leftSecond+"秒");

}

try

{

Thread.sleep(1000);

}

catch(InterruptedException ee)

{

if(是否關閉計時器==true)

return ;

}

while(是否暫停計時==true)

{

try

{

wait();

}

catch(InterruptedException ee)

{

if(是否暫停計時==false)

{

notifyAll();

}

}

}

}

}

}

簡單的JAVA學生管理系統代碼···

lListStudent students = new ArrayListStudent();

BufferedReader br = new BufferedReader(new FileReader("D:\student.txt"));

String tmpStr = br.readLine();

while(tmpStr != null){

int firstIndex = tmpStr.indexOf(" ");

int secondIndex = tmpStr.indexOf(" ",firstIndex + 1);

int thirdIndex = tmpStr.indexOf(" ", secondIndex + 1);

int forthIndex = tmpStr.indexOf(" ", thirdIndex + 1);

Integer stuId = Integer.parseInt(tmpStr.substring(0,firstIndex));

String stuName = tmpStr.substring(firstIndex + 1,secondIndex);

Integer stuYW = Integer.parseInt(tmpStr.substring(secondIndex + 1,thirdIndex));

Integer stuSX = Integer.parseInt(tmpStr.substring(thirdIndex + 1,forthIndex));

Integer stuYY = Integer.parseInt(tmpStr.substring(forthIndex + 1));

Student student = new Student();

student.setStuId(stuId);

student.setStuName(stuName);

student.setStuYW(stuYW);

student.setStuSX(stuSX);

student.setStuYY(stuYY);

students.add(student);

tmpStr.readLine();

}

//創建一個學生實體類 封裝stuId stuName stuYW stuSx stuYY 這5個屬性。。。

//已經幫你把數據拆分出來 并以Student 對象的形式放入集合中了 接下來 給分吧 哇咔咔

java 單機版考試系統 源代碼

這個,我覺得你應該說清楚一點,你要的是用JAVA編寫的考試系統?那么這個系統是考什么的呢?是考JAVA的,還是其他的東東.

求java試題庫管理系統源代碼

試題庫管理系統 題目 分值 統計 隨機抽取

java web == kaifa

急求java學生信息管理系統源代碼,帶有連接數據庫的,萬分感謝

import java.awt.BorderLayout;

import java.awt.CardLayout;

import java.awt.Container;

import java.awt.Font;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.Icon;

import javax.swing.ImageIcon;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JMenu;

import javax.swing.JMenuBar;

import javax.swing.JMenuItem;

import javax.swing.JPanel;

import javax.swing.JToolBar;

import javax.swing.SwingConstants;

public class MainFrame extends JFrame implements ActionListener{

InsertPanel ip = null;

SelectPanel sp = null;

JPanel pframe;

JButton jb1,jb2,jb3;

JMenuItem jm11,jm21,jm22,jm23,jm31,jm32,jm41,jm42;

CardLayout clayout;

public MainFrame(String s){

super(s);

JMenuBar mb = new JMenuBar();

this.setJMenuBar(mb);

JMenu m1 = new JMenu("系統");

JMenu m2 = new JMenu("基本信息");

JMenu m3 = new JMenu("成績");

JMenu m4 = new JMenu("獎懲");

mb.add(m1);

mb.add(m2);

mb.add(m3);

mb.add(m4);

jm11 = new JMenuItem("退出系統");

jm21 = new JMenuItem("輸入");

jm22 = new JMenuItem("查詢");

jm23 = new JMenuItem("更改");

jm31 = new JMenuItem("輸入成績");

jm32 = new JMenuItem("查詢成績");

jm41 = new JMenuItem("獎勵");

jm42 = new JMenuItem("處分");

m1.add(jm11);

m2.add(jm21);

m2.add(jm22);

m2.add(jm23);

m3.add(jm31);

m3.add(jm32);

m4.add(jm41);

m4.add(jm42);

Icon i1 = new ImageIcon();

Icon i2 = new ImageIcon();

Icon i3 = new ImageIcon();

jb1 = new JButton(i1);

jb1.setToolTipText("輸入");

jb2 = new JButton(i2);

jb2.setToolTipText("查詢");

jb3 = new JButton(i3);

jb3.setToolTipText("退出");

JToolBar tb = new JToolBar("系統工具");

tb.add(jb1);

tb.add(jb2);

tb.add(jb3);

add(tb,BorderLayout.NORTH);

jm11.addActionListener(this);

jm21.addActionListener(this);

jm22.addActionListener(this);

jb1.addActionListener(this);

jb2.addActionListener(this);

jb3.addActionListener(this);

clayout = new CardLayout();

pframe = new JPanel(clayout);

add(pframe);

JPanel mainp = new JPanel(new BorderLayout());

JLabel mainl = new JLabel("學生信息管理平臺",SwingConstants.CENTER);

mainl.setFont(new Font("serif",Font.BOLD,30));

mainp.add(mainl);

pframe.add(mainp,"main");

clayout.show(pframe, "main");

}

public void actionPerformed(ActionEvent e){

if(e.getSource() == jm21 || e.getSource() == jb1){

if(ip == null){

ip= new InsertPanel();

pframe.add(ip,"insert");

}

clayout.show(pframe, "insert");

this.setTitle("輸入學生信息");

}

else if(e.getSource() == jm22 || e.getSource() == jb2){

if(sp == null){

sp= new SelectPanel();

pframe.add(sp,"select");

}

clayout.show(pframe, "select");

this.setTitle("查詢學生信息");

}

else if(e.getSource() == jm11 || e.getSource() == jb3){

System.exit(0);

}

}

}

第二個:

import javax.swing.JFrame;

public class MainTest {

public static void main(String [] args){

MainFrame f = new MainFrame("學生信息管理平臺");

f.setSize(400,300);

f.setLocation(350,250);

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.setVisible(true);

}

}

第二個:

import java.sql.Connection;

import java.sql.DriverManager;

public class MySQLConnection {

static Connection getCon(){

Connection con = null;

try{

Class.forName("com.mysql.jdbc.Driver");

con = DriverManager.getConnection("jdbc:mysql://localhost/test","root","123");

}

catch(Exception e){

System.out.println("建立數據庫連接遇到異常!");

}

return con;

}

}

第四個:

import java.awt.BorderLayout;

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JLabel;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import javax.swing.JTextField;

import javax.swing.SwingConstants;

public class SelectPanel extends JPanel implements ActionListener{

JButton jb;

JTextField jt;

JTextField jt1,jt2,jt3,jt4;

public SelectPanel(){

JLabel jl = new JLabel("請輸入學號:",SwingConstants.CENTER);

jt = new JTextField();

jb = new JButton("確定");

JPanel jp1 = new JPanel(new GridLayout(1,3));

jp1.add(jl);

jp1.add(jt);

jp1.add(jb);

JLabel j1,j2,j3,j4;

j1 = new JLabel("學號:",SwingConstants.CENTER);

j2 = new JLabel("姓名:",SwingConstants.CENTER);

j3 = new JLabel("性別:",SwingConstants.CENTER);

j4 = new JLabel("年齡:",SwingConstants.CENTER);

jt1 = new JTextField(6);

jt1.setEditable(false);

jt2 = new JTextField(6);

jt2.setEditable(false);

jt3 = new JTextField(6);

jt3.setEditable(false);

jt4 = new JTextField(6);

jt4.setEditable(false);

JPanel jp2 = new JPanel(new BorderLayout());

JPanel jp3 = new JPanel(new GridLayout(4,2));

jp2.add(new JLabel(""),BorderLayout.NORTH);

jp3.add(j1);

jp3.add(jt1);

jp3.add(j2);

jp3.add(jt2);

jp3.add(j3);

jp3.add(jt3);

jp3.add(j4);

jp3.add(jt4);

jp2.add(jp3);

this.setLayout(new BorderLayout());

add(jp1,BorderLayout.NORTH);

add(jp2);

jb.addActionListener(this);

}

public void actionPerformed(ActionEvent e){

if(e.getSource() == jb){

String stuNo = jt.getText().trim();

Student s = new Student();

boolean b = true;

try{

b = s.selectByStuNo(stuNo);

}

catch(Exception ex){

System.out.println("查詢學生信息遇到異常!");

}

if(b){

jt1.setText(s.getStuNo());

jt2.setText(s.getName());

jt3.setText(s.getGender());

int a = s.getAge();

Integer i = new Integer(a);

jt4.setText(i.toString());

}

else{

JOptionPane.showMessageDialog(null, "無此學生!");

}

}

}

}

第五個:

import javax.swing.JFrame;

public class SelectTest {

public static void main(String [] args){

JFrame f = new JFrame("查詢學生信息");

SelectPanel p = new SelectPanel();

f.add(p);

f.setSize(400,300);

f.setLocation(300,250);

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.setVisible(true);

}

}

第六個:

import java.sql.Connection;

import java.sql.ResultSet;

import java.sql.Statement;

public class Student {

String stuNo;

String name;

String gender;

int age;

public Student(){}

public Student(String stuNo,String name,String gender, int age){

this.stuNo = stuNo;

this.name = name;

this.gender = gender;

this.age = age;

}

public String getStuNo(){

return stuNo;

}

public void setStuNo(String stuNo){

this.stuNo = stuNo;

}

public String getName(){

return name;

}

public void setName(String name){

this.name = name;

}

public String getGender(){

return gender;

}

public void setGender(String gender){

this.gender = gender;

}

public int getAge(){

return age;

}

public void setAge(int age){

this.age = age;

}

public boolean insertStudent(){

boolean b = true;

try{

Connection con = MySQLConnection.getCon();

Statement statement = con.createStatement();

String sql = "insert into student values('" + stuNo + "','" + name +"','" + gender + "'," + age + ")";

sql = new String(sql.getBytes("gb2312"),"ISO8859_1");

statement.executeUpdate(sql);

con.close();

}

catch(Exception e){

b = false;

System.out.println("插入數據庫遇到異常!");

}

return b;

}

public boolean selectByStuNo(String stuNo)throws Exception{

boolean b = true;

Connection con = MySQLConnection.getCon();

Statement statement = con.createStatement();

String sql = "select * from student where stuNo =" + stuNo;

ResultSet rs = statement.executeQuery(sql);

if(rs != null rs.next()){

String no = rs.getString(1);

this.setStuNo(no);

String n = rs.getString(2);

n = new String(n.getBytes("ISO8859_1"),"gb2312");

this.setName(n);

String g = rs.getString(3);

g = new String (g.getBytes("ISO8859_1"),"gb2312");

this.setGender(g);

this.setAge(rs.getInt(4));

b = true;

}

rs.close();

statement.close();

con.close();

return b;

}

}

數據庫你自己弄吧,我沒時間弄了!初學得多動手哦

java學生信息管理系統代碼

你要的太多了!要么只要需求,要么只要代碼。而你的問題里又說提供注釋,說明你不了解什么是弱生信息管理系統。你的問題又提到講講解思路,說明你不懂得把實際的業務需求轉換成程序。就單獨從這個問題看,你不懂的貌似太多,建議你考慮一步步的來,要么先學會寫增刪改查,要么先學會學生信息管理系統的實際需求。

請采納答案,支持我一下。

當前題目:java報考系統代碼 java程序員考試報名網址
鏈接地址:http://m.kartarina.com/article6/dodspig.html

成都網站建設公司_創新互聯,為您提供外貿建站Google響應式網站品牌網站建設面包屑導航網站營銷

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

外貿網站制作
主站蜘蛛池模板: 亚洲精品无码永久中文字幕| 亚洲AV人无码激艳猛片| 无码中文字幕av免费放| 韩国精品一区二区三区无码视频| 国产成人无码免费网站| 精品国产AV无码一区二区三区| 免费无码黄动漫在线观看| 国产亚洲精品无码专区| 无码国产精品一区二区免费式直播 | 无码一区二区三区AV免费| 中文字幕精品无码久久久久久3D日动漫 | 性无码专区一色吊丝中文字幕| 无码久久精品国产亚洲Av影片| 国产做无码视频在线观看| 永久免费av无码不卡在线观看 | 黑人巨大无码中文字幕无码| 国产精品亚洲аv无码播放| 国产免费av片在线无码免费看| av区无码字幕中文色| 亚洲Av综合色区无码专区桃色| 亚洲精品无码永久在线观看| 无码国产精成人午夜视频不卡| av无码国产在线看免费网站| 人妻aⅴ无码一区二区三区| 国产精品无码成人午夜电影| 国产免费黄色无码视频| 亚洲?v无码国产在丝袜线观看| 欧洲黑大粗无码免费| 亚洲AV永久无码精品网站在线观看| 午夜福利无码不卡在线观看 | 无码一区二区三区免费视频| AA区一区二区三无码精片| 中文字幕精品无码一区二区三区 | 亚洲国产精品无码中文字| 日韩人妻无码免费视频一区二区三区| 亚洲一区二区三区无码国产| 91精品日韩人妻无码久久不卡| 日韩精品久久无码中文字幕| 久久AV高潮AV无码AV| 亚洲精品无码中文久久字幕| 亚洲日韩国产AV无码无码精品|