Learning coding means GreatToCode Be more than a Coder ! Greattocode , Join GreatToCode Community,1000+ Students Trusted On Us .If You want to learn coding, Then GreatToCode Help You.No matter what It Takes !


CODE YOUR WAY TO A MORE FULFILLING And HIGHER PAYING CAREER IN TECH, START CODING FOR FREE Camp With GreatToCode - Join the Thousands learning to code with GreatToCode
Interactive online coding classes for at-home learning with GreatToCode . Try ₹Free Per Month Coding Classes With The Top Teachers . Examination management software for school In Java.

Examination management software for school In Java.

Let's create a simple examination management software for a school in Java. This software will allow you to manage student records, enter examination marks, calculate grades, and generate reports. Here's an example implementation to get you started:

```java
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Student {
    private int studentId;
    private String name;
    private List<Integer> marks;

    public Student(int studentId, String name) {
        this.studentId = studentId;
        this.name = name;
        this.marks = new ArrayList<>();
    }

    public int getStudentId() {
        return studentId;
    }

    public String getName() {
        return name;
    }

    public List<Integer> getMarks() {
        return marks;
    }

    public void addMark(int mark) {
        marks.add(mark);
    }
}

public class ExaminationManager {
    private List<Student> students;

    public ExaminationManager() {
        this.students = new ArrayList<>();
    }

    public void addStudent(int studentId, String name) {
        Student student = new Student(studentId, name);
        students.add(student);
        System.out.println("Student added: " + studentId + " - " + name);
    }

    public void enterMarks(int studentId, int[] marks) {
        Student student = findStudent(studentId);

        if (student != null) {
            for (int mark : marks) {
                student.addMark(mark);
            }
            System.out.println("Marks entered for student: " + studentId);
        } else {
            System.out.println("Student not found.");
        }
    }

    public void calculateGrades() {
        for (Student student : students) {
            List<Integer> marks = student.getMarks();
            int totalMarks = 0;
            for (int mark : marks) {
                totalMarks += mark;
            }
            int averageMarks = totalMarks / marks.size();
            String grade = calculateGrade(averageMarks);
            System.out.println("Student: " + student.getName());
            System.out.println("Average Marks: " + averageMarks);
            System.out.println("Grade: " + grade);
        }
    }

    public void generateReport(int studentId) {
        Student student = findStudent(studentId);

        if (student != null) {
            System.out.println("Student Report");
            System.out.println("Student ID: " + student.getStudentId());
            System.out.println("Name: " + student.getName());
            System.out.println("Marks: " + student.getMarks());
            int totalMarks = 0;
            for (int mark : student.getMarks()) {
                totalMarks += mark;
            }
            int averageMarks = totalMarks / student.getMarks().size();
            String grade = calculateGrade(averageMarks);
            System.out.println("Average Marks: " + averageMarks);
            System.out.println("Grade: " + grade);
        } else {
            System.out.println("Student not found.");
        }
    }

    private Student findStudent(int studentId) {
        for (Student student : students) {
            if (student.getStudentId() == studentId) {
                return student;
            }
        }
        return null;
    }

    private String calculateGrade(int averageMarks) {
        if (averageMarks >= 90) {
            return "A+";
        } else if (averageMarks >= 80) {
            return "A";
        } else if (averageMarks >= 70) {
            return "B";
        } else if (averageMarks >= 60) {
            return "C";
        } else if (averageMarks >= 50) {
            return "D";
        } else {
            return "F";
       

Post a Comment

0 Comments

•Give The opportunity to your child with GreatToCode Kid's • Online Coding Classes for Your Kid • Introduce Your kid To the world's of coding
•Fuel You Career with our 100+ Hiring Partners, Advance Your Career in Tech with GreatToCode. •Join The Largest Tech and coding Community and Fast Forward Your career with GreatToCode. •10000+ Learner's+ 90 % placement Guarantee. • Learning Coding is Better with the GreatToCode community .
•Greattocode Kid's •GreatToCode Career •GreatToCode Interview •GreatToCode Professional •GreatToCode for schools •GreatToCode For colleges •GreatToCods For Businesses.
Are you ready to join the millions of people learning to code? GreatToCode Pass is your one-stop-shop to get access to 1000+ courses, top-notch support, and successful job placement. What are you waiting for? Sign up now and get your future in motion with GreatToCode Pass.