import java.io.*;
public class Assigment1
{
public static void main(String[] args)
{
String studName[] = {"Amad bin Abu", "Dollah bin Daud", "Milah bin Malek","Sarah bin Shamsuddin","Idris bin Ibrahim"};
int test1[] = {9,73,76,85,70};
int test2[] = {9,64,79,87,72};
int totalMarks[] ={0,0,0,0,0};
String[] status = new String [5];
CalculateMarks(test1,test2,totalMarks);
DetermineStatus(totalMarks,status);
Display(studName,totalMarks,status);
}
public static void CalculateMarks(int t1[],int t2[],int tmark[])
{
for(int i=0;i<marks.length;i++)
{
int mark = 0,test1,test2;
test1 = (15*test1[i])/100;
test2 = (25*test2[i])/100;
totalMark = test1[i] + test2[i];
}
}
public static void DetermineStatus(int[] tmark,String status[])
{
int totalMarks = 0;
for(int i=0;i<marks.length;i++)
{
if(totalMarks[i] >=0 && totalMarks[i] <=20)
{
status[i]="Cannot sit final exam";
}
if(totalMarks[i] >=21 && totalMarks[i] <=25)
{
status[i]="Must sit the 3rd test";
}
if(totalMarks[i] >=26 && totalMarks[i] <=35)
{
status[i]="Allow to sit the final exam";
}
if(totalMarks[i] >=36 && totalMarks[i] <=40)
{
status[i]="Excluded from sitting the final exam";
}
}
public static void Display(String studName[],int[] tmark,String status[])
{
for(int i=0;i<marks.length;i++)
{
System.out.print("\n Student Name : "+studName[i]);
System.out.print("\n Total Mark : "+tmark[i]);
System.out.print("\n Status : "+status[i]);
}
return;
}
}