Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package yoav24mar;
- import java.util.Arrays;
- import java.util.Scanner;
- public class reain {
- public static Scanner in = new Scanner(System.in);
- public boolean isInGroup(Student st, Student[] group){
- for(int i = 0; i<group.length; i++){
- if(group[i].equals(st)) return true;
- }
- return false;
- }
- public static int gradeSt(int[] ans){
- int temp = 0;
- int score = 0;
- for(int i = 0; i<ans.length; i++){
- temp = (int)(Math.random()*4)+1;
- if(temp == ans[i]){
- score = score + 5;
- }
- }
- return score;
- }
- public static void Update(Student[] group, int[] ans){
- int tscore = 0;
- for(int i = 0; i<group.length;i++){
- tscore = gradeSt(ans);
- Student tret = new Student("Adolf", tscore);
- group[i] = tret;
- }
- }
- public static void main(String[] args) {
- Student stue = new Student("Danny",5);
- stue.setGrade(0);
- System.out.println(stue.toString());
- Student[] stGroup = new Student[10];
- for(int i = 1; i < stGroup.length; i++){
- stGroup[i] = new Student("Adolf",0);
- }
- int[] answers = new int[20];
- for(int i = 0; i<answers.length; i++){
- answers[i] = (int)(Math.random()*4)+1;
- }
- Update(stGroup, answers);
- for(int i = 0; i < stGroup.length; i++){
- System.out.println(stGroup[i].toString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement