Professional Documents
Culture Documents
21BCE2879
Q2)
Write a java program that gets five subject marks of five students along with the student's
registration number as row label and store it in a string array. Then display the following:
Registration numbers of a student who has secured maximum averag
Registration numbers of a students who failed in one subject (less than 40marks)
CODE-
import java.io.*;
import java.util.*;
import java.lang.*;
class Main{
int avgScore;
Integer.parseInt(file[i + 2]) +
Integer.parseInt(file[i + 3])) / 3;
maxAvgScore = avgScore;
names.clear();
names.add(file[i]);
names.add(file[i]);
}
for (int i = 0; i < names.size(); i++) {
System.out.println(maxAvgScore);
if(i%4==0){
continue;
if(Integer.parseInt(file[i])<40){
System.out.println("21BCT8398 20");
getStudentsList(file);
Output-