帮忙修改一下这个程序Java

来源:百度知道 编辑:UC知道 时间:2024/05/26 16:17:25
public class StudentScoreTest
{
public static void main(String args[])throws IOException
{
String k,n,s;
int a;

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.println("请输入最大学生人数:");
s= in.readLine();
a=Integer.parseInt(s);
StudentScore sg=new StudentScore(a);
Student x=new Student("李四","002",86,92,97,3.7,"345");
Student y=new Student("张三","001",90,95,96,4.0,"123");

sg.append(x);
sg.append(y);

while(true)
{
System.out.println("**请选择您的身份**");
System.out.println(" 0.退出系统");
System.out.println(" 1.用户");
System.out.println(" 2.管理员");
System.out.println("***************");

你都没给出StudentScore,和Student类,怎改或?你这个StudentScoreTest类没有导入必要的库:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

SB总是这样问问题,要改成怎么样的也不说

你这个程序写得太没水平了,
最基本的东西,起码的结构你都不知道,数组的声名你也不会!!!!
强烈建议你多看看基础知识。

你这里有好几个大问题!三楼说的对!我在这帮你定义了两个类StudentScore,和Student。能编译通过了! 但我还不是很清楚你要达到什么要求哦!所以我只能帮到这儿了!建议楼主多看看书
import java.io.*;
class StudentScore{ //定义一个StudentScore类
int studentscore=0;
StudentScore(int a){
this.studentscore=a;
}
Student[] a=new Student[studentscore];
void append(Student b){
int i=0;
while(true){
a[i]=b;
i++;
}
}
int search(String s){
for(int i=0;i<10;i++){
if(a[i].b==s){
return Integer.parseInt(s);
}
}
return 0;
}
}
class Student{ //定义一个Student类
String a,b,h;
int c,d,e;
double f;
Student(String a,String b,int c,in