i am new to java and i was trying to solve a program,
a) i wanted to print marks scored by 3 students in 3 subjects.
b) i wanted to get the total marks scored by each student and find out the highest total marks scored.
c)I also want to find the highest mark in each subject and by whom.
i have done a coding i was able to get a) done and b) partly done,can anyone help me with the coding so i can complete the problem.
[B]class Exam1
{
public static void main(String args[])
{
int [][]subject= {{1,50,66,55},{2,40,42,48},{3,70,90,68}};
// display subject array//
for(int i=0;i<3;i++)
{
for(int j=0;j<4;j++)
{
System.out.print(subject[i][j] +"\t");
}
System.out.println( " ");
}
//to print total marks//
for(int i=0;i<3;i++)
{
int sum=0;
for(int j=1;j<4;j++)
{
sum= sum+ subject[i][j];
}
System.out.println("total marks of candidate "+ subject[i][0] + "=" + sum);
}
}
}[/B]