⑴ 要求编写一个java程序,输入学生信息,并能保存与显示学生信息。
Java 代码如下:import java.util.ArrayList;
import java.util.Scanner;public class student{
private int number;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public student(){}
public student(int number, String name) {
this.number = number;
this.name = name;
}
public student writeInfo(){
student st = new student();
Scanner in = new Scanner(System.in);
System.out.println("请输入学生的学号:");
number = in.nextInt();
st.setNumber(number);
System.out.println("请输入学生的姓名:");
String name = in.next();
st.setName(name);
return st;
}
public void readInfo(ArrayList list){
for(int i=0;i<=list.size()-1;i++){
student st = new student();
st = (student) list.get(i);
System.out.println("第"+(i+1)+"位学生的学号:" + st.getNumber());
System.out.println("第"+(i+1)+"位学生的姓名:" + st.getName());
}
}
public static void main(String[]args){ ArrayList<student> list = new ArrayList<student>();
student st = new student();
Scanner in = new Scanner(System.in);
while(true){
System.out.println("1、输入学生信息");
System.out.println("2、输出学生信息");
System.out.println("请选择:");
int option = in.nextInt();
switch (option) {
case 1:
list.add(st.writeInfo());
break;
case 2:
st.readInfo(list);
break;
default:
break;
}
}
}
}
⑵ 求毕业设计及论文“基于Java的学生信息管理系统的设计与实现”
你这个需求比较艰难, 空手套白狼不太可能有人会给你
首先这个课题非常简内单
第一容: 代码层面就是用springmvc 或者springboot之类的框架, 数据层采用hibernate/myts, 不要想着自己手写servlet了, 那个工作量太大, 随便套一个主题就能用了
第二: 论文方面可以去文库里东拼西凑一番, 毕竟本科论文讲来讲去都是那些东西, 写一些每个框架的优点, 自己的业务设计, 数据库设计, 测试样例等等就能拼个一万字的论文了
Look at my name ~ you will find the code
⑶ Java设计开发一个简单的学生管理系统!
如果是你一个人开发,那就照着需求一步步做呗。比如:
首先要有登录版界面,登录界面设计好,需要传权入的参数有 用户名,密码,登录身份;这时你就设计一个数据库表 user(login_name,login_password,login_type);这时候登录进去,因为不同人的权限工作内容不同,因此登录进去显示的界面和选项也不同,你需要设计3种界面(学生:单一的查询成绩(此时你就需要创建一个学生表student(id,name,score));教师:查看学生成绩以及自己的教学科目,此时创建一个教师表teacher(id,name,course);管理员:这个页面设计是重头戏,数据处理先做好(以@RequestMapping(“/xxxx.do”)为主,设计rest api用于提供页面请求接口,建议使用spring_servlet和hibernate配合实现,使用MVC分层设计。
⑷ 用JAVA定义一个学生类Student来表示学生信息,学生类中包含成员有学号(id)、姓名(name)、年龄和成绩
如下所示:
public class Student {
private int sNo; //学号
private String name; //姓名
private String sex; //性别
private int yu; //语文
private int shu; //数学
private int wai; //外语
public int getsNo() {
return sNo;
}
public void setsNo(int sNo) {
this.sNo = sNo;
}
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 getYu() {
return yu;
}
public void setYu(int yu) {
this.yu = yu;
}
public int getShu() {
return shu;
}
public void setShu(int shu) {
this.shu = shu;
}
public int getWai() {
return wai;
}
public void setWai(int wai) {
this.wai = wai;
}
⑸ Java实现一个简单的学生信息管理系统
看了你的需求,其实除了java,你还可以用易查分来做查询管理系统呢!通过易查分 不用写代码,上 传个excel表格就可以生成,超级简单的!
⑹ 你能把你的java的学生信息系统给我吗我把我的提问分给你,我就是要一个MVC模式的
汗,网络一搜一大堆,
基本上都是mvc啊,不知道你有没有印象,java中就已经内置了mvc模式。
java中把m和c整合到一起了。
⑺ java中实现对学生信息的输入、输出、修改、查找,该如何做
Java代码如下:importjava.util.ArrayList;
importjava.util.Scanner;publicclassstudent{
privateintnumber;
privateStringname;
publicStringgetName(){
returnname;
}
publicvoidsetName(Stringname){
this.name=name;
}
publicintgetNumber(){
returnnumber;
}
publicvoidsetNumber(intnumber){
this.number=number;
}
publicstudent(){}
publicstudent(intnumber,Stringname){
this.number=number;
this.name=name;
}
publicstudentwriteInfo(){
studentst=newstudent();
Scannerin=newScanner(System.in);
System.out.println("请输入学生的学号:");
number=in.nextInt();
st.setNumber(number);
System.out.println("请输入学生的姓名:");
Stringname=in.next();
st.setName(name);
returnst;
}
publicvoidreadInfo(ArrayListlist){
for(inti=0;i<=list.size()-1;i++){
studentst=newstudent();
st=(student)list.get(i);
System.out.println("第"+(i+1)+"位学生的学号:"+st.getNumber());
System.out.println("第"+(i+1)+"位学生的姓名:"+st.getName());
}
}
publicstaticvoidmain(String[]args){ArrayList<student>list=newArrayList<student>();
studentst=newstudent();
Scannerin=newScanner(System.in);
while(true){
System.out.println("1、输入学生信息");
System.out.println("2、输出学生信息");
System.out.println("请选择:");
intoption=in.nextInt();
switch(option){
case1:
list.add(st.writeInfo());
break;
case2:
st.readInfo(list);
break;
default:
break;
}
}
}
}
⑻ 1. 使用JAVA定义一个表示学生信息的类Student,
publicclassStudent{
privateintid;//表示学号,
privateStringname;//表示姓名,
privateStringsex;//表示性别,
privateintage;//表示年龄,
privatedoublecomputer_score;//表示计算机课程的成绩内,
privatedoubleEnglish_score;//表示英语课容的成绩,
privatedoubleMaths_score;//表示数学课的成绩,
privatedoubletotal_score;//表示总成绩,
privatedoubleave_score;//表示平均成绩。
//自动生成getset方法
public...get...
publicvoidset...
}
⑼ 怎么用Java 程序设计(学生注册信息窗体设计)
如果一道简单的题,你放在这里还没有问题,但是这个基本可以做一个小型的系统了....我建议你去博客找吧,而且你还没有财富....
⑽ 制作学生信息(姓名,学号,成绩)管理系统(用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;
}
}