java问题,请高手解决

2024-12-27 10:55:32
推荐回答(1个)
回答1:

class Paper{
Questions questions;
Answers rightAnswers;
Records userRecords;
Pager(){
questions = new Questions();
rightAnswers = questions.getAllAnswers();
userRecords = new Records();
}
public void showPaper(int qNumber){
System.out.println(questions.getQuestion(qNumber));
if(userRecords.contains(qNumber))
System.out.println(userRecords.getRecord(qNumber));
}
public boolean gradeQuestion(int qNumber){
if(userRecords.contains(qNumber)&&rightAnswers.contains(qNumber)){
return rightAnsers.getAnswer(qNumber).equals(userRecords.getRecord(qNumber))
}
}
}
差不多了,剩下的你自己琢磨吧