查重问题
package pers.YSH.testnow;
import java.util.Scanner;
class ScoreInformation
{
Scanner sc = new Scanner(System.in);
private String stunumber;
private String name;
private String stuclass;
private String papertitle;
private String paperbody;
private double paperpass;
private boolean paperreview;
public ScoreInformation(String stunumber,String name,String stuclass,String papertitle,String paperbody,double paperpass,boolean paperreview)
{
this.stunumber = stunumber;
this.name = name;
this.stuclass = stuclass;
this.papertitle = papertitle;
this.paperbody = paperbody;
this.paperpass = paperpass;
this.paperreview = paperreview;
}
public void setstunumber(String stunumer)
{
this.stunumber = stunumer;
}
public String getstunumber()
{
return this.stunumber;
}
public void setname(String name)
{
this.name = name;
}
public String getname()
{
return this.name;
}
public void setstuclass(String stuclass)
{
this.stuclass = stuclass;
}
public String getstuclass()
{
return this.stuclass;
}
public void setpapertitle(String papertitle)
{
this.papertitle = papertitle;
}
public String getpapertitle()
{
return this.papertitle;
}
public void setpaperbody(String paperbody)
{
this.paperbody = paperbody;
}
public String getpaperbody()
{
return this.paperbody;
}
public void setpaperpass(double paperpass)
{
this.paperpass = paperpass;
}
public double getpaperpass()
{
return this.paperpass;
}
public void setpaperview(boolean paperreview)
{
this.paperreview = paperreview;
}
public boolean getpaperreview()
{
return this.paperreview;
}
}
public class PaperManagement
{
Scanner sc = new Scanner(System.in);
private ScoreInformation[] students = {null,null,null,null,null};
public void upload()
{
System.out.println("***************************************************");
System.out.println(" 石家庄铁道大学软件工程系");
System.out.println(" 毕业设计论文管理系统2021版");
System.out.println("***************************************************");
System.out.println("请输入学生学号:");
String stuNo = sc.next();
System.out.println("\n***************************************************");
int iTemp = 0;
students[0] = new ScoreInformation("11111111","张三","信2005-2",null,null,2.05,true);
students[1] = new ScoreInformation("22222222","李四","信2005-2",null,null,2.05,true);
students[2] = new ScoreInformation("33333333","王五","信2005-2",null,null,2.05,true);
students[3] = new ScoreInformation("44444444","赵六","信2005-2",null,null,2.05,true);
students[4] = new ScoreInformation("20203986","刘德凯","信2005-2",null,null,2.05,true);
boolean bFlag = true;
for(;;)
{
for(iTemp = 0;iTemp < 5;iTemp++)
{
if((students[iTemp].getstunumber()).equals(stuNo))
{
System.out.print("学生学号:" + students[iTemp].getstunumber() + "\n");
System.out.print("学生姓名:" + students[iTemp].getname() + "\n");
System.out.print("所在班级:" + students[iTemp].getstuclass() + "\n");
System.out.println("请输入您的毕业设计论文题目:");
String s = sc.next();
if(s.length() > 10)
{
break;
}
students[iTemp].setpapertitle(s);
System.out.println("请输入论文正文:");
String paper = sc.next();
if(paper.length() > 200)
{
System.out.println("您输入的信息错误,请重新输入!");
break;
}
students[iTemp].setpaperbody(paper);
System.out.println("***************************************************");
System.out.println(" 石家庄铁道大学软件工程系");
System.out.println(" 毕业设计论文管理系统2021版");
System.out.println("***************************************************");
bFlag = false;
break;
}
}
if(bFlag)
{
System.out.println("该学号不存在");
}
else
{
break;
}
}
}
public void check()
{
System.out.println("***************************************************");
System.out.println(" 石家庄铁道大学软件工程系");
System.out.println(" 毕业设计论文管理系统2021版");
System.out.println(" 毕业设计论文查重");
System.out.println("***************************************************");
System.out.println("请输入学生学号:");
String stuNo = sc.next();
System.out.println("\n***************************************************");
int iTemp = 0;
boolean bFlag = true;
for(;;)
{
for(iTemp = 0;iTemp < 5;iTemp++)
{
if((students[iTemp].getstunumber()).equals(stuNo))
{
System.out.print("学生学号:" + students[iTemp].getstunumber() + "\n");
System.out.print("学生姓名:" + students[iTemp].getname() + "\n");
System.out.print("所在班级:" + students[iTemp].getstuclass() + "\n");
System.out.print("论文题目:" + students[iTemp].getpapertitle() + "\n");
System.out.print("论文正文:" + students[iTemp].getpaperbody() + "\n");
System.out.println("请输入毕业设计论文查重率:");
double pass = sc.nextDouble();
students[iTemp].setpaperpass(pass);
System.out.println("(Y/N)\n***************************************************");
String str2 = sc.next();
char cSure = str2.charAt(0);
if(cSure == 'Y')
{
bFlag = false;
}
bFlag = false;
break;
}
System.out.println("***************************************************");
System.out.println(" 石家庄铁道大学软件工程系");
System.out.println(" 毕业设计论文管理系统2021版");
System.out.println("***************************************************");
bFlag = false;
break;
}
if(bFlag)
{
System.out.println("该学号不存在");
}
else
{
break;
}
}
}
public void examine()
{
System.out.println("***************************************************");
System.out.println(" 石家庄铁道大学软件工程系");
System.out.println(" 毕业设计论文管理系统2021版");
System.out.println(" 毕业设计论文审查");
System.out.println("***************************************************");
System.out.println("请输入学生学号:");
String stuNo = sc.next();
System.out.println("\n***************************************************");
int iTemp = 0;
boolean bFlag = true;
for(;;)
{
for(iTemp = 0;iTemp < 5;iTemp++)
{
if((students[iTemp].getstunumber()).equals(stuNo))
{
System.out.print("学生学号:" + students[iTemp].getstunumber() + "\n");
System.out.print("学生姓名:" + students[iTemp].getname() + "\n");
System.out.print("所在班级:" + students[iTemp].getstuclass() + "\n");
System.out.print("论文题目:" + students[iTemp].getpapertitle() + "\n");
System.out.print("论文正文:" + students[iTemp].getpaperbody() + "\n");
System.out.println("毕业设计论文查重率:" + students[iTemp].getpaperpass());
if(students[iTemp].getpaperpass() > 0.2)
{
System.out.println("该学生毕业设计论文重复率超过20%,不允许进行论文审查");
return;
}
System.out.println("是否同意思该学生参加毕业设计答辩(Y/N):")
String str1 = sc.next();
char Sure = str1.charAt(0);
if(Sure == 'Y')
{
students[iTemp].setpaperview(true);
bFlag = false;
}
else if(Sure == 'N')
{
students[iTemp].setpaperview(false);
}
}
System.out.println("***************************************************");
System.out.println(" 石家庄铁道大学软件工程系");
System.out.println(" 毕业设计论文管理系统2021版");
System.out.println("***************************************************");
bFlag = false;
break;
}
if(bFlag)
{
System.out.println("该学号不存在");
}
else
{
break;
}
}
}
public void enterMenu()
{
boolean bFlag = true;
while(bFlag)
{
System.out.println("***************************************************");
System.out.println(" 石家庄铁道大学软件工程系");
System.out.println(" 毕业设计论文管理系统2021版");
System.out.println("***************************************************");
System.out.println(" 1.毕业设计论文提交");
System.out.println(" 2.毕业设计论文查重");
System.out.println(" 3.毕业设计论文审查");
System.out.println(" 4.退出论文管理系统");
System.out.println("***************************************************");
String str1 = sc.next();
char cmenu = str1.charAt(0);
switch(cmenu)
{
case '1':
upload();
break;
case '2':
check();
break;
case '3':
examine();
break;
case '4':
System.out.println("***************************************************");
System.out.println(" 石家庄铁道大学软件工程系");
System.out.println(" 毕业设计论文管理系统2021版");
System.out.println(" 制作人:刘德凯") ;
System.out.println("***************************************************");
bFlag = false;
break;
}
}
}
public void End()
{
System.out.printIn("");
while(bflag)
{
exit(0);
}
}