
import java.io.*;

public class ExamMark

{
        public static void main (String args[]) throws IOException
        
        {
                int homework=0;
                int testscore=0;
                int average=0;
                
                //sets up the datainputstream to read in numbers
                DataInputStream in = new DataInputStream(System.in);
                
                String home = new String();
                String test = new String();
                
                System.out.flush();
                
                System.out.println("Enter the Homework mark up to 100 ");
                home = in.readLine(); // reads the users input in for the homework
                homework = Integer.parseInt(home); // converts string home into an integer, homework
                
                System.out.flush();// Clears the input stream
                
                System.out.println("Enter the Test score mark out of 100 ");
                test = in.readLine(); // reads the users input in for the test score
                testscore = Integer.parseInt(test);// converts the string test to an integer , testscore
                
                if (homework<=100)
                 {
                          System.out.println("You have inputted the following scores :");
                          System.out.println("Homework = " + homework );      
                  }
                else 
                  {
                          System.out.println("You have entered a wrong result. Please try again");
                  }  
               
                if (testscore<=100)
                  {  
                          System.out.println("Test Score = " + testscore );
                  }
                else
                  {
                          System.out.println("You have entered a wrong result. Please try again");
                   }
                   
                average = (homework+testscore)/2;
                
                System.out.println("The average score for this student is " + average );
                
                if (average>=60)
                {
                        System.out.println("This student has passed the exam with a average score of " + average);
                }
                else
                {
                        System.out.println("This student has failed the exam with a average score of " + average);
                }
      }

}//ends main          
             
