import [Link].
*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class Person
int personId;
String personName;
String personAddress;
}
public class Solution
public static void main(String args[]) throws IOException
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
Scanner sc = new Scanner([Link]);
int n = [Link]();
Person persons[] = new Person[n];
for(int i=0;i<n;i++)
persons[i] = new Person();
persons[i].personId = [Link]();
persons[i].personName = [Link]();
persons[i].personAddress = [Link]();
for(int i=0; i<n; i++)
[Link](persons[i].personId);
[Link](persons[i].personName);
[Link](persons[i].personAddress);
}
Questin 2
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class Student
int studentId;
String studentName;
float studentMarks;
public class Solution {
public static void main(String args[] ) throws Exception {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
Scanner sc = new Scanner([Link]);
int n = [Link]();
Student[] students = new Student[n];
for(int i=0;i<n;i++)
students[i] = new Student();
students[i].studentId = [Link]();
[Link](); // note this step
students[i].studentName = [Link]();
students[i].studentMarks = [Link]();
float totalScore = findTotalStudentMarks(students);
[Link](totalScore);
}
public static float findTotalStudentMarks(Student[] students)
float totalScore = 0;
for(int i=0; i<[Link];i++)
totalScore += students[i].studentMarks;
return totalScore;
Question 3
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class Student
int studentId;
String studentName;
float studentMarks;
public class Solution {
public static void main(String args[]) throws Exception
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
Scanner sc = new Scanner([Link]);
int n = [Link]();
Student[] students = new Student[n];
for(int i=0;i<n;i++)
students[i] = new Student();
students[i].studentId = [Link]();
[Link](); // note this step
students[i].studentName = [Link]();
students[i].studentMarks = [Link]();
float avgScore = findAverageStudentMarks(students);
[Link]("%.2f", avgScore); //to round off to 2 decimal places
public static float findAverageStudentMarks(Student[] students)
int n = [Link];
float totalScore = 0;
for(int i=0; i<n;i++)
totalScore += students[i].studentMarks;
return totalScore/n;
Question 4
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class Student
int studentId;
String studentName;
float studentMarks;
public class Solution {
public static void main(String args[] ) throws Exception {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
Scanner sc = new Scanner([Link]);
int n = [Link]();
Student[] students = new Student[n];
for(int i=0;i<n;i++)
students[i] = new Student();
students[i].studentId = [Link]();
[Link](); // note this step
students[i].studentName = [Link]();
students[i].studentMarks = [Link]();
float minScore = findMinimumStudentMarks(students);
[Link](minScore);
public static float findMinimumStudentMarks(Student[] students)
int n = [Link];
float minScore = students[0].studentMarks;
for(int i=0; i<n;i++)
if(students[i].studentMarks < minScore)
minScore = students[i].studentMarks;
return minScore;
}
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class Student
int studentId;
String studentName;
float studentMarks;
public class Solution {
public static void main(String args[] ) throws Exception {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
Scanner sc = new Scanner([Link]);
int n = [Link]();
Student[] students = new Student[n];
for(int i=0;i<n;i++)
students[i] = new Student();
students[i].studentId = [Link]();
[Link](); // note this step
students[i].studentName = [Link]();
students[i].studentMarks = [Link]();
float maxScore = findMaximumStudentMarks(students);
[Link](maxScore);
public static float findMaximumStudentMarks(Student[] students)
int n = [Link];
float maxScore = students[0].studentMarks;
for(int i=0; i<n;i++)
if(students[i].studentMarks > maxScore)
maxScore = students[i].studentMarks;
}
return maxScore;
Question 6
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class Student
int studentId;
String studentName;
float studentMarks;
public class Solution {
public static void main(String args[] ) throws Exception {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
Scanner sc = new Scanner([Link]);
int n = [Link]();
Student[] students = new Student[n];
for(int i=0;i<n;i++)
students[i] = new Student();
students[i].studentId = [Link]();
[Link](); // note this step
students[i].studentName = [Link]();
students[i].studentMarks = [Link]();
[Link](); // note this step
String name = [Link]();
int stID = findStudent(students, name);
if(stID == -1)
[Link]("No student found");
else
[Link](stID);
public static int findStudent(Student[] students, String name)
int n = [Link];
for(int i=0; i<n;i++)
if(students[i].[Link](name))
return students[i].studentId;
return -1;
Question 7
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class Student
int studentId;
String studentName;
float studentMarks;
public class Solution {
public static void main(String args[] ) throws Exception {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
Scanner sc = new Scanner([Link]);
int n = [Link]();
Student[] students = new Student[n];
for(int i=0;i<n;i++)
students[i] = new Student();
students[i].studentId = [Link]();
[Link](); // note this step
students[i].studentName = [Link]();
students[i].studentMarks = [Link]();
int marks = [Link]();
int countOfStudent = countTheStudentWhoHasScoredGreaterMarks(students,
marks);
[Link](countOfStudent);
public static int countTheStudentWhoHasScoredGreaterMarks(Student[] students,
int marks)
int n = [Link];
int count = 0;
for(int i=0; i<n;i++)
if(students[i].studentMarks > marks)
count++;
return count;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class Student
{
int studentId;
String studentName;
float studentMarks;
public class Solution {
public static void main(String args[] ) throws Exception {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
Scanner sc = new Scanner([Link]);
int n = [Link]();
Student[] students = new Student[n];
for(int i=0;i<n;i++)
students[i] = new Student();
students[i].studentId = [Link]();
[Link](); // note this step
students[i].studentName = [Link]();
students[i].studentMarks = [Link]();
int marks = [Link]();
int countOfStudent = countTheStudentWhoHasScoredLowerMarks(students,
marks);
[Link](countOfStudent);
public static int countTheStudentWhoHasScoredLowerMarks(Student[] students, int
marks)
int n = [Link];
int count = 0;
for(int i=0; i<n;i++)
if(students[i].studentMarks < marks)
count++;
return count;