0% found this document useful (0 votes)
3 views9 pages

Java Student Marks Management System

Uploaded by

nanduasbn
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views9 pages

Java Student Marks Management System

Uploaded by

nanduasbn
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;

class Student {
int studentId;
String studentName;
float studentMarks;

Student(int id, String name, float marks){


[Link] = id;
[Link] = name;
[Link] = marks;
}
}
public class Solution {
public static void main(String args[] ) throws Exception {
Scanner s = new Scanner([Link]);
int n = [Link]();
[Link]();
int id;
String name;
float marks;
Student[] student = new Student[n];
for(int i = 0; i < n; i++){
id = [Link]();
[Link]();
name = [Link]();
marks = [Link]();
student[i] = new Student(id,name,marks);
}
float min = findMinimumMarks(n, student);
[Link](min);
}

public static float findMinimumMarks(int n, Student[] student ){


float min = student[0].studentMarks;
for(int i = 0; i < n ; i++){
if(student[i].studentMarks < min ){
min = student[i].studentMarks;
}
}
return min;
}
}
2

import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;

class Student{
int studentId;
String studentName;
float studentMarks;

Student(int id, String name, float marks){


[Link] = id;
[Link] = marks;
[Link] = name;
}
}
public class Solution {
public static void main(String args[] ) throws Exception {
Scanner s = new Scanner([Link]);
int n = [Link]();
Student[] student = new Student[n];

[Link]();

for(int i = 0; i < n ; i++) {


int id = [Link]();
[Link]();
String name = [Link]();
float marks = [Link]();
student[i] = new Student(id, name, marks);
}
float max = findMaximumMarks(student);
[Link](max);
}

public static float findMaximumMarks(Student[] student ){


float max = 0;
for(int i = 0; i < [Link]; i++){
if (student[i].studentMarks > max){
max = student[i].studentMarks;
}
}
return max;
}
}
3
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;

import [Link];

class Student{
int studentId;
String studentName;
String studentAddress;

Student(int id, String name, String address){


[Link] = id;
[Link] = name;
[Link] = address;
}
}

public class Solution {


public static void main(String args[] ) {
Scanner s = new Scanner([Link]);
int n = [Link]();
[Link]();
Student[] student = new Student[n];

int id;
String name,address;
// float marks;
// String address;

for(int i = 0; i <n; i++){


id = [Link]();
[Link]();
name = [Link]();
address = [Link]();
// [Link]();
// student[i] = new Student(id, name, m);
student[i]= new Student(id, name, address);
}

for(int i = 0; i <n; i++){


[Link](student[i].studentId);
[Link](student[i].studentName);
[Link](student[i].studentAddress);
}

}
}
4

import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
class Student{
int id;
String name;
float marks;

Student(int id, String name, float marks){


[Link] = id;
[Link] = name;
[Link] = marks;
}
}
public class Solution {
public static void main(String args[] ) throws Exception {
Scanner s = new Scanner([Link]);
int n = [Link]();
[Link]();
Student[] student = new Student[n];

for(int i = 0; i < n ; i++){


int id = [Link]();
[Link]();
String name = [Link]();
float marks = [Link]();
student[i] = new Student(id, name, marks);
}
float avg = findAverage(student);
[Link]("%.2f", avg);

public static float findAverage(Student[] student){


float sum = 0;
for(int i = 0; i < [Link]; i++){
sum += student[i].marks;
}
float avg = sum/[Link];
return avg;
}
}
5
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;

class Student{
int id;
String name;
float marks;
Student(int id, String name, float marks){
[Link] = id;
[Link] = marks;
[Link] = name;
}

}
public class Solution {
public static void main(String args[] ) throws Exception {
Scanner s = new Scanner([Link]);
int n = [Link]();
[Link]();
Student[] student = new Student[n];

for(int i = 0; i<n; i++){


int id = [Link]();
[Link]();
String name = [Link]();
float marks = [Link]();
[Link]();
student[i] = new Student(id, name, marks);
}

String search = [Link]();


int result = findStudent(student, search);

if(result == 0){
[Link]("No student found");
}
else
[Link](result);
}

public static int findStudent(Student[] student, String search){


for(int i = 0 ; i < [Link]; i++){
if(student[i].[Link](search)){
return student[i].id;
}
}
return 0;
}
}

6
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;

class Student {
int studentId;
String studentName;
float studentMarks;

Student(int id, String name, float marks){


[Link] = id;
[Link] = name;
[Link] = marks;
}
}

public class Solution {


public static void main(String args[] ) throws Exception {
Scanner s = new Scanner([Link]);
int n = [Link]();
Student[] student = new Student[n];

[Link]();

for(int i = 0; i < n ; i++) {


int id = [Link]();
[Link]();
String name = [Link]();
float marks = [Link]();
student[i] = new Student(id, name, marks);
}
float sum = 0;
for(int i = 0; i<n; i++){
sum += student[i].studentMarks;
}

[Link](sum);
}
}

You might also like