// 22.5HV2 Software Engineering II // Unit 2 Exercise 3 import java.io.*; public class test_student { public static void main(String[] args) { InputStreamReader istream = new InputStreamReader(System.in); BufferedReader keyboard = new BufferedReader(istream); student [] group = new student[3]; int i, ex=0, cw, sp=0, pm; System.out.println("Hello"); group[0] = new student("Joe Bloggs"); group[1] = new student("Tina Turner"); group[2] = new student("Alpha Blondy"); try{ for (i=0;i<3;i++) { System.out.println("Enter exam mark for student "+group[i].get_name()+": "); ex = Integer.parseInt(keyboard.readLine()); System.out.println("Enter course work mark for student "+group[i].get_name()+": "); cw = Integer.parseInt(keyboard.readLine()); group[i].set_marks(ex,cw); } System.out.println("Enter percentage split for exam: "); sp = Integer.parseInt(keyboard.readLine()); student.set_split(sp); //student.set_pass(ex); System.out.println("split = "+student.get_split()+"% exam, "+ (100-(int) student.get_split())+"% course work"); System.out.println("pass mark = " + student.get_pass()); for (i=0;i<3;i++) group[i].show_result(); } catch(Exception e) { System.err.println("you must enter an integer"); System.exit(0); } } }