首页 > 编程知识 正文

java成绩管理系统,Java成绩管理系统程序系统总结

时间:2024-04-27 11:08:32 阅读:334572 作者:RMAN

本文目录一览:

java设计一个学生成绩管理系统?

public static void main(String[] args) throws IOException {

Scanner sc = new Scanner(System.in);

String exit="";

MapString, ListFloat map1=new HashMap();

while(!exit.equals("exit")) {

System.out.println("请出入学生姓名");

ListFloat list = new ArrayListFloat();

map1.put(sc.next(), list);

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

System.out.println("请出入学生成绩");

list.add(sc.nextFloat());

}

System.out.println("输入 exit 退出成绩录入,其他则继续录入");

exit=sc.next();

}

for(String key :map1.keySet()) {

ListFloat list =map1.get(key);

float avage =0l;

for(Float box :list) {

avage += box;

}

System.out.println(key+"的平均成绩:"+ avage/list.size());

}

}

//只做了第一题,追加分数,可得第二题答案

JAVA:编写一个学生成绩管理系统。学生的属性包括学号、姓名、年龄等。

class Student{

String name;

String id;

int age;

Couse[] course;

}

class Course{

String coursename;

float pscourse;

float qzcourse;

float sxcourse;

float qmcourse;

float zpcourse;

}

这个要写好长时间的,定义几个类;然后实现具体的功能。用数组或者集合来存储学生信息还有成绩信息,最后定义一个测试类。你可以找我私聊,1368270359qq

如何用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编写一个学生成绩管理系统. //1.学生类 学号 姓名 年龄 语数外三科成绩(三科成绩)?

用数组可以,也可以用集合来存储各个同学的成绩。

添加删除等信息简单。

这里有个迷你图书管理系统,类似,我刚写的。你看看之后应该会有思路了。如果用集合utils做的话,也简单,知识用到了集合框架和泛型等机制。

package cn.kgc.sg.MiTuSys;

import java.util.Scanner;

public class MiNiBookSys {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

// 定义书的信息

String[] bookNames = new String[4];

int[] borrowDate = new int[5];

int[] borrowCount = new int[4];

int[] states = new int[4];

// 定义书单信息

String[] bookMeg = new String[5];

bookMeg[0] = "Java开发";

bookMeg[1] = "C#开发";

bookMeg[2] = "C语言开发";

states[2] = 0; // 0:可借阅 1:已借出

// 初始化两个图书借阅记录信息

bookNames[0] = "安徒生童话";

borrowDate[0] = 15;

borrowCount[0] = 4;

states[0] = 0; // 0:可借阅 1:已借出

bookNames[1] = "格林童话";

states[1] = 1; // 0:可借阅 1:已借出

borrowDate[1] = 26;

borrowCount[1] = 9;

// 搭建项目框架

int num = -1;// 定义用户初始输入的数字

do {

System.out.println("*********************欢迎使用图书管理系统**********************");

System.out.println("ttt1.新增图书");

System.out.println("ttt2.查看图书");

System.out.println("ttt3.删除图书");

System.out.println("ttt4.图书借阅");

System.out.println("ttt5.归还图书");

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

System.out.print("请输入您的选择:");

int choose = sc.nextInt();

// 判断输入的选择是否正确

while (choose 0 || choose 6) {

System.out.print("输入有误,请重新输入:");

choose = sc.nextInt();

}

// 定义一个flag变量,来定义是否退出系统

boolean flag = true;// true:不退出系统 false:退出系统

String addName = null;

switch (choose) {

case 1:

System.out.println("n*********1.新增图书*********");

boolean isAdd = true;

System.out.println("序号tt图书书名");

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

// 判断为空的不输出

if (bookMeg[i] != null) {

System.out.println((i + 1) + "tt" + bookMeg[i]);

}

}

System.out.print("请输入新增图书名称:");

addName = sc.next();

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

// 判断为空的不输出

if (bookMeg[i] == null) {

bookMeg[i] = addName;

break;

}

}

/*bookMeg[bookMeg.length-1] = addName;      //添加图书信息

*/ System.out.println("n序号tt图书书名");

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

// 判断为空的不输出

if (bookMeg[i] != null) {

System.out.println((i + 1) + "tt" + bookMeg[i]);

}

}

if (!isAdd) {

System.out.println("对不起,图书已满,不能添加!!!");

}

break;

case 2:

System.out.println("n*********2.查看图书*********");

System.out.println("序号" + "t图书书名" + "t   借阅次数 t借阅状态t借阅日期t");

// 遍历数组

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

// 判断信息为空的不输出

if (bookNames[i] != null) {

String borrowCounts = borrowCount[i] + "次";

String borrowDates = borrowDate[i] + "日";

String state = (states[i] == 0) ? "可借阅" : "已借出";

System.out.println((i + 1) + "t" + bookNames[i] + "t   " + borrowCounts + "t " + state

+ "t " + borrowDates);

}

}

break;

case 3:

System.out.println("n*********3.删除图书*********");

System.out.println("序号tt图书书名");

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

// 判断为空的不输出

if (bookMeg[i] != null) {

System.out.println((i + 1) + "tt" + bookMeg[i]);

}

}

System.out.print("请输入删除的图书序号:");

int delNo = sc.nextInt();

// 判断输入的序号是否有误

while (delNo 1 || delNo bookMeg.length) {

System.out.print("输入有误,重新输入:");

delNo = sc.nextInt();

}

// 删除图书

for (int i = 0; i =bookMeg.length-1;i++) {

if (bookMeg[i] != null i == delNo - 1) { 

bookMeg[i] = bookMeg[i+1];

bookMeg[i+1] = null;    //

// 最后置空

bookMeg[bookMeg.length - 1] = null;

}

}

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

// 判断为空的不输出

if (bookMeg[i] != null) {

System.out.println((i + 1) + "tt" + bookMeg[i]);

}

}

break;

case 4:

System.out.println("n*********4.图书借阅*********");

System.out.println("n序号tt图书书名tt借阅状态tt借阅次数tt借阅日期");

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

// 判断为空的不输出

if (bookMeg[i] != null) {

String state = (states[i] == 0) ? "可借阅" : "已借出";

String borrowCi = borrowCount[i] + "次";

System.out.println((i + 1) + "tt" + bookMeg[i] + "tt" + state + "tt" + borrowCi + "tt"

+ borrowDate[i]);

}

}

System.out.print("请输入您要借阅的图书序号:");

int borrowNo = sc.nextInt();

boolean isFind = true;// false:找不到

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

// 查到了,但是状态是0可借阅,可以借阅

if (i == borrowNo - 1 states[i] == 0) {

isFind = true;

// 改变状态为已借出

states[i] = 1;

// 借阅次数加一

borrowCount[i]++;

// 输入借阅日期

System.out.print("请输入借阅日期:");

int borrow = sc.nextInt();

// 对输入的日期判断

while (borrow 1 || borrow 31) {

System.out.print("您输入日期有误,请重新输入:");

borrow = sc.nextInt();

}

// 更新借阅日期

borrowDate[i] = borrow;

} else if (i == borrowNo - 1 states[i] == 1) {

// 查到了,但是状态是1已借出,不可以借阅

isFind = true;

System.out.println("状态是已借出,不可以借阅!!!");

}

}

if (!isFind) {

System.out.println("找不到图书!");

break;

}

break;

case 5:

System.out.println("n*********5.归还图书*********");

System.out.println("n序号tt图书书名tt借阅状态tt借阅次数tt借阅日期");

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

// 判断为空的不输出

if (bookMeg[i] != null) {

String state = (states[i] == 0) ? "可借阅" : "已借出";

String borrowCi = borrowCount[i] + "次";

System.out.println((i + 1) + "tt" + bookMeg[i] + "tt" + state + "tt" + borrowCi + "tt"

+ borrowDate[i]);

}

}

System.out.print("请输入您要归还的图书序号:");

int huanNo = sc.nextInt();

// 判断归还的序号是否合法

while (huanNo 1 || huanNo bookMeg.length - 1) {

System.out.print("输入的归还图书序号有误,请重新输入:");

huanNo = sc.nextInt();

}

boolean isHuan = true;// false:找不到

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

// 查到了,但是状态是1已借出,可以还

if (i == huanNo - 1 states[i] == 1) {

isHuan = true;

// 改变状态为已借出

states[i] = 0;

// 输入归还日期

System.out.print("请输入归还日期:");

int huan = sc.nextInt();

// 对归还的日期判断,必须大于借阅日期

while (huan 1 || huan 31) {

System.out.print("您输入日期有误,请重新输入(1-31):");

huan = sc.nextInt();

}

while (huan borrowDate[i]) {

System.out.print("归还日期必须大于借阅日期" + borrowDate[i] + "号,请重新输入:");

huan = sc.nextInt();

}

borrowCount[i]++;

System.out.println("归还图书成功!!!");

} else if (i == huanNo - 1 states[i] == 0) {

// 查到了,但是状态是0可借阅,不能还

isFind = true;

System.out.println("状态是可借阅,不可以归还!!!");

}

}

if (!isHuan) {

System.out.println("抱歉,找不到图书,不能归还图书!");

break;

}

break;

case 6:

System.out.println("n*********6.退出系统*********");

flag = false;

break;

default:

flag = false;

break;

}

if (flag) {

System.out.print("输入0返回:");

num = sc.nextInt();

} else {

break;

}

} while (num == 0);

System.out.println("**********谢谢使用**********");

}

}

希望能帮到你!!!

用java做一个学生成绩管理系统需要哪些技术?

用java做一个学生成绩管理系统,可以用到如下技术:

后台:ssh框架,不用框架的话,单纯地用jsp

+

servlet也可以。

前台:html

+

css

+

js

+

jquery

数据库:掌握sql语言的编写,数据库的连接。复杂的项目还需要用到存储过程。

基于java设计一个学生成绩管理系统,要求有界面,且有增加,查询,修改,删除,退出功能,代码如何写?

import java.awt.Color;

import java.awt.Font;

import java.awt.Frame;

import java.awt.Label;

import java.awt.TextField;

import java.awt.Window;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.awt.event.WindowAdapter;

import java.awt.event.WindowEvent;

import java.sql.SQLException;

import javax.swing.JButton;

public class Stmessege {

Font font = new Font("楷体", Font.BOLD, 18);

private Frame m = new Frame("登陆成功界面");

protected Window f;

public Stmessege() {

m.addWindowListener(new WindowAdapter() {

public void windowClosing(WindowEvent evt) {

m.setVisible(false);

m.dispose();

System.exit(0);

}

});

m.setSize(460, 360);

m.setBackground(Color.green);

m.setLayout(null);

m.setLocationRelativeTo(null);

Label l0 = new Label("管理员信息");

Font font1 = new Font("楷体", Font.BOLD, 32);

l0.setForeground(Color.blue);

l0.setSize(180, 50);

l0.setLocation(150, 30);

l0.setFont(font1);

final Label l1 = new Label("姓名:");

l1.setSize(60, 20);

l1.setLocation(10, 100);

l1.setFont(font);

TextField tf1 = new TextField("黄朋");

tf1.setForeground(Color.blue);

tf1.setBackground(Color.white);

tf1.setSize(50, 20);

tf1.setLocation(70, 100);

final Label l2 = new Label("学号:");

l2.setSize(60, 20);

l2.setLocation(140, 100);

l2.setFont(font);

TextField tf2 = new TextField("111265");

tf2.setForeground(Color.blue);

tf2.setBackground(Color.white);

tf2.setSize(60, 20);

tf2.setLocation(190, 100);

final Label l3 = new Label("性别:");

l3.setSize(60, 20);

l3.setLocation(280, 100);

l3.setFont(font);

TextField tf3 = new TextField("男");

tf3.setForeground(Color.blue);

tf3.setBackground(Color.white);

tf3.setSize(40, 20);

tf3.setLocation(360, 100);

final Label l4 = new Label("班级:");

l4.setSize(60, 20);

l4.setLocation(10, 170);

l4.setFont(font);

TextField tf4 = new TextField("611231");

tf4.setForeground(Color.blue);

tf4.setBackground(Color.white);

tf4.setSize(60, 20);

tf4.setLocation(67, 170);

final Label l5 = new Label("系别:");

l5.setSize(60, 20);

l5.setLocation(140, 170);

l5.setFont(font);

TextField tf5 = new TextField("计算机工程系");

tf5.setForeground(Color.blue);

tf5.setBackground(Color.white);

tf5.setSize(80, 20);

tf5.setLocation(200, 170);

final Label l6 = new Label("成绩:");

l6.setSize(60, 20);

l6.setLocation(280, 170);

l6.setFont(font);

TextField tf6 = new TextField("95");

tf6.setForeground(Color.blue);

tf6.setBackground(Color.white);

tf6.setSize(40, 20);

tf6.setLocation(360, 170);

final Label l7 = new Label("专业:");

l7.setSize(60, 20);

l7.setLocation(10, 230);

l7.setFont(font);

TextField tf7 = new TextField("软件技术");

tf7.setForeground(Color.blue);

tf7.setBackground(Color.white);

tf7.setSize(60, 20);

tf7.setLocation(70, 230);

JButton btn1 = new JButton("添加");

btn1.setForeground(Color.blue);

btn1.setSize(80, 38);

btn1.setLocation(35, 300);

btn1.setFont(font);

btn1.addActionListener(new ActionListener() {

@Override

public void actionPerformed(ActionEvent e) {

// TODO Auto-generated method stub

new 插入();

m.setVisible(true);

}

});

JButton btn2 = new JButton("查询学生学籍信息");

btn2.setForeground(Color.blue);

btn2.setSize(200, 38);

btn2.setLocation(135, 300);

btn2.setFont(font);

btn2.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

Stmessege1 f;

try {

f = new Stmessege1();

f.Stmessege11();

m.setVisible(true);

} catch (SQLException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

} catch (ClassNotFoundException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

}

});

JButton btn3 = new JButton("删除");

btn3.setForeground(Color.blue);

btn3.setSize(80, 38);

btn3.setLocation(350, 300);

btn3.setFont(font);

btn3.addActionListener(new ActionListener() {

@Override

public void actionPerformed(ActionEvent e) {

// TODO Auto-generated method stub

new 删除();

//f.setVisible(false);

m.setVisible(true);

}

});

JButton btn4 = new JButton("更新");

btn4.setForeground(Color.blue);

btn4.setSize(80, 38);

btn4.setLocation(200, 230);

btn4.setFont(font);

btn4.addActionListener(new ActionListener() {

@Override

public void actionPerformed(ActionEvent e) {

// TODO Auto-generated method stub

new 更新();

m.setVisible(true);

}

});

m.add(l0);

m.add(l1);

m.add(tf1);

m.add(l2);

m.add(tf2);

m.add(l3);

m.add(tf3);

m.add(l4);

m.add(tf4);

m.add(l5);

m.add(tf5);

m.add(l6);

m.add(tf6);

m.add(l7);

m.add(tf7);

m.add(btn1);

m.add(btn2);

m.add(btn3);

m.add(btn4);

m.setVisible(true);

}

public static void main(String[] args) {

new Stmessege();

}

}

可以仿照我的做一下,希望采纳,我才一级哦

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。