Write a program to calculate the fees of a student based on the number of subjects.
import java.util.;
public class TuitionFees {
int c=0,fees=0,total=0;
void input()
{
Scanner sc = new Scanner(System.in);
System.out.println("ENTER THE NUMBER OF SUBJECTS : ");
c=sc.nextInt();
System.out.println("ENTER THE SUBJECTS : ");
String sub[]=new String[c];
for(int i=0;i<c;i++)
{
sub[i]=sc.next();
}
}
void calculate()
{
fees = c300;
if(c>4)
total=fees - ((c-2)*70);
else
total=fees;
}
void display()
{
System.out.println("FEES : " + fees);
System.out.println("TOTAL FESS : " + total);
}
public static void main(String[]args)
{
TuitionFees ob = new TuitionFees();
ob.input();
ob.calculate();
ob.display();
}
}