Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- /**
- * Created by DarkCasual on 30.03.2017.
- */
- public class Teacher {
- final static String[] resultIs5 = {" Keep up the good work!", " You should go to MIT with results like these!",
- " I wish you were my child!", "Come here and let me give you a kiss!"};
- final static String[] resultIs3or4 = {" You could have done better, you know. I'm going to inform your parents of your performance.",
- " I am not happy with your performance.", " You should consider a career in floor sweeping."};
- final static String[] resultIs2 = {" Get outta here, you fuckwit!", " You should be ashamed of yourself!",
- " You deserve some corporeal punishment, go fetch the belt."};
- void commentingOnResults(Student[] students) {
- Random random = new Random();
- System.out.println("Attention, students! Here are your exam results, listen closely.");
- for (Student student : students) {
- int currentStudentMark = student.mark;
- System.out.print(student.name + ", group " + student.group + ", your result is " + currentStudentMark + ".");
- if (currentStudentMark == 5) {
- System.out.println(" " + resultIs5[random.nextInt(resultIs5.length)]);
- }
- if (currentStudentMark >= 3) {
- System.out.println(" " + resultIs3or4[random.nextInt(resultIs3or4.length)]);
- }
- if (currentStudentMark < 3) {
- System.out.println(" " + resultIs2[random.nextInt(resultIs2.length)]);
- }
- }
- System.out.println("Class dismissed, everybody out!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement