资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

学分管理java系统代码,java教务系统代码

求用Java编写的学生成绩管理系统的完整代码,要能运行的

以下方法实现了用户界面登陆

目前创新互联已为千余家的企业提供了网站建设、域名、网络空间、绵阳服务器托管、企业网站设计、库伦网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

import java.awt.*;

import java.awt.event.*;

public class DengLuJieMian extends Frame implements ActionListener

{

Label username=new Label("用户名:");//使用文本创建一个用户名标签

TextField t1=new TextField();//创建一个文本框对象

Label password=new Label("密码:");//创建一个密码标签

TextField t2=new TextField();

Button b1=new Button("登陆");//创建登陆按钮

Button b2=new Button("取消");//创建取消按钮

public DengLuJieMian()

{

this.setTitle("学生信息管理系统");//设置窗口标题

this.setLayout(null);//设置窗口布局管理器

username.setBounds(50,40,60,20);//设置姓名标签的初始位置

this.add(username);// 将姓名标签组件添加到容器

t1.setBounds(120,40,80,20);// 设置文本框的初始位置

this.add(t1);// 将文本框组件添加到容器

password.setBounds(50,100,60,20);//密码标签的初始位置

this.add(password);//将密码标签组件添加到容器

t2.setBounds(120,100,80,20);//设置密码标签的初始位置

this.add(t2);//将密码标签组件添加到容器

b1.setBounds(50,150,60,20);//设置登陆按钮的初始位置

this.add(b1);//将登陆按钮组件添加到容器

b2.setBounds(120,150,60,20);//设置取消按钮的初始位置

this.add(b2);// 将取消按钮组件添加到容器

b1.addActionListener(this);//给登陆按钮添加监听器

b2.addActionListener(this);// 给取消按钮添加监听器

this.setVisible(true);//设置窗口的可见性

this.setSize(300,200);//设置窗口的大小

addWindowListener(new WindowAdapter()

{

public void windowClosing(WindowEvent e)

{

System.exit(0);

}

});//通过内部类重写关闭窗体的方法

}

public void actionPerformed(ActionEvent e)

{

if(e.getSource()==b1)//处理登陆事件

{

String name=t1.getText();

String pass=t2.getText();

if(name!=nullpass.equals("000123"))//判断语句

{

new StudentJieMian();

}

}

}

public static void main(String args[])//主函数

{

new DengLuJieMian();

}

}

以下方法实现了学生界面设计

import java.awt.*;

import java.awt.event.*;

class StudentJieMian extends Frame implements ActionListener

{

MenuBar m=new MenuBar();//创建菜单栏

Menu m1=new Menu("信息");//创建菜单“信息”

MenuItem m11=new MenuItem("插入");//创建“插入”的菜单项

MenuItem m12=new MenuItem("查询");

Menu m2=new Menu("成绩");//创建菜单“成绩”

MenuItem m21=new MenuItem("查询");

public StudentJieMian()

{

this.setTitle("学生界面");//设置窗口标题

this.setLayout(new CardLayout());//设置窗口布局管理器

this.setMenuBar(m);//将菜单栏组件添加到容器

m.add(m1);//将信息菜单放入菜单栏

m.add(m2);

m1.add(m11);//将“插入”菜单项添加到“信息”菜单

m1.add(m12); //将“查询”菜单项添加到“信息”菜单

m2.add(m21); //将“查询”菜单项添加到“成绩”菜单

m11.addActionListener(this); //给“插入”菜单项添加监听器

m12.addActionListener(this); //给“查询”菜单项添加监听器

m21.addActionListener(this); //给“查询”菜单项添加监听器

this.setVisible(true); //设置窗口的可见性

this.setSize(300,200); //设置窗口的大小

addWindowListener(new WindowAdapter()

{

public void windowClosing(WindowEvent e)

{

System.exit(0);//关闭窗口

}

});

}

public void actionPerformed(ActionEvent e)

{

if(e.getSource()==m11) //处理“添加信息”事件

{

new AddStudent();

}

if(e.getSource()==m12) //处理“查询信息”事件

{

new SelectStudent();

}

if(e.getSource()==m21) //处理“查询成绩”事件

{

new ChengJiStudent();

}

}

public static void main(String args[])

{ new StudentJieMian(); //创建一个对象 }

如何用Java语言编写学生成绩管理系统

package student;

import java.util.Scanner;

public class teststudent {

public static void main(String args[]){

System.out.println("************************学生成绩管理系统*********************");

System.out.println("请输入要管理的学生人数:");

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();

studentMassage stum = new studentMassage(n);

int flag = 1;

while(flag == 1){

System.out.println("1.输入学生信息");

System.out.println("2.通过姓名查找学生信息");

System.out.println("3.显示全部学生信息");

System.out.println("4.退出系统");

int op = sc.nextInt();

switch(op){

case 1:stum.addStudent(n);

new Scanner(System.in).nextLine();

break;

case 2:

System.out.println("输入学生姓名:");

String name = sc.next();

stum.FindStudent(name);

new Scanner(System.in).nextLine();

break;

case 3:

stum.showallStudent();

new Scanner(System.in).nextLine();

break;

case 4:

flag = 0;

System.out.println("已退出系统!");

break;

default:

System.out.println("输入有误!");

new Scanner(System.in).nextLine();

}

}

}

}

class Date{

int year;

int month;

int day;

/*public Date(int year,int month,int day){

this.year = year;

this.month = month;

this.day = day;

}

public Date(){}*/

public String showDate(){

return year + "/"+ month+"/"+day;

}

}

class student{

int id;

String name;

Date date;

float score;

public student(){

id = 0;

name = null;

date = null;

score = 0f;

}

public void showStudent(){

System.out.println( id + " " + name + " "+ " " + date.showDate()+" "+score);

}

}

class studentMassage{

private student[] stu;

private int flag;

public studentMassage(int n){

flag = 0;

if(stu == null){

stu = new student[n];

for(int i =0;in;++i){

stu[i] = new student();

}

}

}

public void addStudent(int n){

flag = 1;

Scanner sc = new Scanner(System.in);

System.out.println("请输入"+n+"个学生信息");

for(int i = 0 ;istu.length;++i){

stu[i].date = new Date();

System.out.println("请输入第"+(i+1)+"个学生学号:");

stu[i].id = sc.nextInt();

System.out.println("请输入第"+(i+1)+"个学生姓名:");

stu[i].name = sc.next();

System.out.println("请输入第"+(i+1)+"个学生出生年份:");

stu[i].date.year = sc.nextInt();

System.out.println("请输入第"+(i+1)+"个学生出生月份:");

stu[i].date.month = sc.nextInt();

System.out.println("请输入第"+(i+1)+"个学生出生日期:");

stu[i].date.day = sc.nextInt();

//stu[i].date = new Date(year,month,day);

System.out.println("请输入第"+(i+1)+"个学生分数:");

stu[i].score = sc.nextFloat();

}

}

public void FindStudent(String sname){

student find = null;

if(flag != 0){

for(int i = 0;istu.length;++i){

if(sname.equals(stu[i].name))

find = stu[i];

}

if(find == null)

System.out.println("查无此人!");

else

find.showStudent();

}else

System.out.println("没有输入学生信息!");

}

public void showallStudent(){

System.out.println("所有学生的信息如下:");

System.out.println("学号 姓名 生日 分数");

for(int i = 0;istu.length;++i){

stu[i].showStudent();

}

}

}

如何用java来编一个学生成绩管理系统的程序?

同意上面的说法..

你需要一个IO包.实例化输入输出流.对文件进行输入输出的操作.

你先把这些类文件都写好.这些类文件都很简单.写一个实例,省去一些代码..

public class Person

{

public string studentName;

public string studentAge;

//省略其它成员变量

public void setStudentName(string strName)

{

this.studentName=strName;

}

public string getStudentName()

{

return this.studentName;

}

//其它成员函数类似

}

上面一个类的实例..其他类差不多,然后写一个类.实例化这些类,用文件IO输入输出流,对文件进行操作.这里代码你自己去写,不会网上多的是.


网页题目:学分管理java系统代码,java教务系统代码
文章URL:http://cdkjz.cn/article/dsshccp.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220