Facebook
From Little Lizard, 3 Years ago, written in Java.
This paste is a reply to Re: Untitled from Mammoth Guinea Pig - view diff
Embed
Download Paste or View Raw
Hits: 173
  1. public static boolean evaluateApplication(Student student){
  2.          
  3.         boolean result = true;
  4.        
  5.        
  6.                 if(student.getAlesResult()==0){
  7.                         System.out.println("You cannot apply without ALES Result !..");
  8.              
  9.                 }
  10.                        
  11.                         else
  12.             {
  13.               if(student.getYdsResult()==0){
  14.                         System.out.println("You cannot apply without YDS Result !..");
  15.                  
  16.                         }
  17.             }
  18.  
  19.             if(student.getAlesResult()!=0 & student.getYdsResult()!=0){
  20.  
  21.                 if(student.getAlesResult()>=85 && student.getYdsResult()>=75 && student.getGpa()>=2.5)
  22.                     return result;
  23.  
  24.                 else{
  25.                       if (student.getAlesResult()<85 &  student.getAlesResult()!=0){
  26.                             System.out.println("ALES score must be higher than 85.");
  27.                            result = !result;
  28.                       }
  29.  
  30.                       else if(student.getYdsResult()<75 & student.getYdsResult()!=0){
  31.                             System.out.println("YDS score must be higher than 75.");
  32.                            result = !result;
  33.                       }
  34.  
  35.                       else if(student.getGpa()<2.5){
  36.                             System.out.println("GPA must be at least 2,5.");
  37.                             result=!result;
  38.                       }
  39.                 }
  40.             }
  41.          return result;
  42.     }