Array Programming in Java
<p>This is the Registration Class stored as Registration.java.</p>

<pre><code>public class Registration {
    int registrationId;
    double fees;
    int marks;
public void setRegistrationId(int registrationId){
    this.registrationId=registrationId;
}
public int getRegistrationId(){
    return registrationId;
}
public void setFees(double fees){
    this.fees=fees;
}
public double getFees(){
    return fees;
}
public void calculateFees(int marks){
    int discount=0;
    if(marks&gt;=85 &amp;&amp; marks&lt;=100)
        discount = 12;
    else if(marks&gt;=75 &amp;&amp; marks&lt;=84)
        discount = 7;
    else if(marks&gt;=65 &amp;&amp; marks&lt;=74)
        discount = 0;
    else
        System.out.println("You have not passed!");
    fees = fees-(fees*(discount/100.0));
    System.out.println("The discount availed is "+discount+" % and the fees after discount is: "+fees);
}
}
</code></pre>

<p>Another class called DemoReg1.java which hosts the starter method.</p>

<pre><code>public class DemoReg1 {

  public static void main(String[] args) {
    int branchList[]={1001,1002,1003,1004,1005};
    double fees[]= {25575,15500,33750,8350,20500};      
    Registration reg = new Registration();
    reg.setRegistrationId(2001);
    int branchId=1002;      
    double fees1=0;
    for(int i=0;i&lt;branchList.length;i++)
    {
        if(branchList[i]==branchId)
        { 
            fees1=fees[i];
            reg.setFees(fees1);
            System.out.println("The Registration ID is:"+reg.getRegistrationId());
            System.out.println("The fees before discount is:"+reg.getFees());
            reg.calculateFees(79);
            break;
        } 
       }
      }
    }
</code></pre>

<p>The output which I get is:</p>

<pre><code>The Registration ID is:2001
The fees before discount is:15500.0
The discount availed is 7 % and the fees after discount is: 14415.0
</code></pre>

<p>I want to add an 'else' condition which prints out the following statement when the branchId provided(local variable) is say 1006.</p>

<pre><code>System.out.println("Invalid branch ID");
</code></pre>

<p>Where in the code should I add the above statement? 
Thanks!</p>
