import java.io.*;
public class assingmnt1
{
//main program
public static void main (String[]args)
{
String studName[]={"Luqman Hakim Bin Hussein","Muhammad Irfan Bin Marzuki","Nur Hasniza Binti Illias","Nur Aqilah Asyikin Binti Mohd Jani","Nurul Syazareen Binti Md Said"};
int test1[] = {70,34,65,100,54};
int test2[] = {69,77,35,78,90};
int totalMarks[] = {0,0,0,0,0};
String status[]=new String[5];
CalculateMarks(test1,test2,totalMarks);
DetermineStatus(totalMarks,status);
Display(studName, totalMarks, status);
}
//calculate total marks
public static void CalculateMarks(int t1[], int t2[], int tmarks[])
{
for (int i=0;i<5;i++)
{
tmarks = (t1[i]*0.15) + (t2[i]*25/100);
}
}
//determined status
public static void DetermineStatus(int[] tmarks, String status[])
{
for(int i=0;i<5;i++)
{
if(tmarks[i] >=0 && tmarks[i] <=20)
{
status[i]="Cannot sit final exam";
}
if(tmarks[i] >=21 && tmarks[i] <=25)
{
status[i]="Must sit the 3rd test";
}
if(tmarks[i] >=26 && tmarks[i] <=35)
{
status[i]="Allow to sit the final exam";
}
if (tmarks[i] >=36 && tmarks[i] <=40)
{
status[i]="Excluded from sitting the final exam";
}
}
}
//display all
public static void Display(String studName[], int tmarks[], String status[])
{
for (int i=0; i<5;i++)
{
System.out.print ("\n Student Name : "+studName[i]);
System.out.print ("\n Total Marks : "+tmarks[i]);
System.out.print ("\n Student Status : "+status[i]);
}
System.out.println();
}
}