please people in this program how can we explain step by step of culcalation part ,the tyeacher whos teaching me is a very hotempered man and he wouldnt explain me except the output .
this program i have to writ in final exam this month 28/12/2005 for Gods sake
class Student{
String name;
int id;
int fees=500;
public void changeFees(){
fees = fees + fees*5/100;
System.out.println(“The fees are “+fees);
}
}
class FirstYearStudent extends Student{
public void changeFees(){
fees = fees +fees
System.out.println(“The fees are “+fees);
}
}
class SecondYearStudent extends Student{
public void changeFees(){
fees = fees +fees*5/100 +50;
System.out.println(“The fees are “+fees);
}
}
class ThirdYearStudent extends Student{
public void changeFees(){
fees =fees +fees
System.out.println(“The fees are “+fees);
}
public static void main(String[] abc){
Student s=new SecondYearStudent();
s.changeFees();
Student s2=new FirstYearStudent();
s2.changeFees();
}
}