各位java大神,有谁能给我做一个小小的项目(学生信息管理系统)很简单的那种 高悬赏
发布网友
发布时间:2022-05-24 18:29
我来回答
共5个回答
热心网友
时间:2023-10-25 05:00
public static void firstInit(){
System.out.println("|----------欢迎进入学生管理系统-----------|");
System.out.println("|----------------------------------------|");
}
public static void addStudentInit(){
System.out.println("|----------------------------------------|");
System.out.println("|--1.添加学生信息---2.查询-----3.退出-----|");
System.out.println("|----------------------------------------|");
}
public static Student addStudent(){
Scanner scanner = new Scanner(System.in);
System.out.print("请输入学号:");
String id = scanner.next();
System.out.print("请输入姓名:");
String name = scanner.next();
System.out.print("请输入性别:");
String sex = scanner.next();
System.out.print("请输入年龄:");
String age = scanner.next();
System.out.print("请输入专业:");
String major = scanner.next();
Student student = new Student(id, name, sex, age, major);
return student;
}
热心网友
时间:2023-10-25 05:00
换成200块现金可以考虑
热心网友
时间:2023-10-25 05:01
分都是问题,现在没有免费的好程序的
热心网友
时间:2023-10-25 05:01
视力不太好,看不清你发的图,多的功能你将方法调用注释掉就可以,缺功能的话你再联系我吧
热心网友
时间:2023-10-25 05:02
package database;
import java.io.*;
import java.util.Scanner;
public class FileRW {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
int key;
File file = new File("D:/", "FileRW.txt");
file.createNewFile();
FileOutputStream fileWrite = new FileOutputStream(file, true);
System.out.println("|----欢迎进入学生信息管理系统----|");
System.out.println("|--------------------------------|");
do {
System.out.println("|--------------------------------|");
System.out.println("|--1添加学生信息 2查询 3退出-----|");
System.out.println("|--------------------------------|");
System.out.print("请选择操作:");
key = in.nextInt();
if (key == 1) {
System.out.print("请输入学号:");
String id = in.next();
System.out.print("请输入姓名:");
String name = in.next();
System.out.print("请输入性别:");
String sex = in.next();
System.out.print("请输入年龄:");
int age = in.nextInt();
System.out.print("请输入专业:");
String major = in.next();
System.out.print("是否保存:");
String save = in.next();
if (save.equals("y")) {
byte record[] = (id + "\t\t" + name + "\t\t" + sex + "\t\t"
+ age + "\t\t" + major + "\n").getBytes();
fileWrite.write(record);
}
}
if (key == 2) {
System.out.println("学号\t\t姓名\t\t性别\t\t年龄\t\t专业");
BufferedReader fileRead = new BufferedReader(new FileReader(
file));
String buffer = null;
while (null != (buffer = fileRead.readLine())) {
System.out.print(buffer);
System.out.println("");
}
fileRead.close();
System.out.println("");
}
} while (key != 3);
fileWrite.close();
in.close();
}
}