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

OOP MP

The Student Grading System is a software application designed to automate the grading process by calculating student grades based on marks in five subjects. It features a user-friendly interface for data input, percentage calculation, grade assignment, and record storage. Future enhancements may include support for additional subjects and user authentication.

Uploaded by

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

OOP MP

The Student Grading System is a software application designed to automate the grading process by calculating student grades based on marks in five subjects. It features a user-friendly interface for data input, percentage calculation, grade assignment, and record storage. Future enhancements may include support for additional subjects and user authentication.

Uploaded by

alamk765432
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Introduction

The Student Grading System is a software application designed to calculate student grades based
on marks obtained in five subjects. This system aims to simplify the process of grading students
and provide accurate results.

Objective:

The primary objective of this project is to develop a user-friendly system that:

1. Accepts student data (name, roll number)


2. Accepts marks for five subjects (English, Mathematics, Science, History, Computer Science)
3. Calculates percentage
4. Assigns grade based on percentage
5. Writes records to a file

Scope:

This project will benefit educational institutions by:

1. Automating the grading process


2. Reducing manual errors
3. Providing quick and accurate results
4. Maintaining student records

Limitations:

1. Limited to five subjects


2. No provision for additional subjects or electives
3. No user authentication or authorization

System Overview:

The system will consist of:

1. User interface for inputting student data and marks


2. Calculation module for percentage and grade
3. Display module for showing student records
4. File management module for storing records

1|Page
System Requirements

Hardware Requirements:

1. Processor: Intel Core i3 or equivalent


2. RAM: 4 GB or more
3. Storage: 500 MB available space
4. Operating System: Windows/Linux/MacOS

Software Requirements:

1. C++ Compiler (e.g., GCC, Clang)


2. Text Editor/IDE (e.g., Visual Studio, Sublime Text)
3. File System (for storing student records)

Functional Requirements:

1. Accept student data (name, roll number)


2. Accept marks for 5 subjects (English, Mathematics, Science, History, Computer Science)
3. Calculate percentage
4. Assign grade based on percentage
- 90-100%: A
- 80-89%: B
- 70-79%: C
- 60-69%: D
- Below 60%: F
5. Display student record
6. Write record to file (student_records.txt)

Non-Functional Requirements:

1. User-friendly interface
2. Efficient data storage and retrieval
3. Accurate calculations
4. Robust error handling

Assumptions and Dependencies:

1. User will provide valid input.


2. File system will be available for storing records.
3. C++ compiler will support standard libraries.

This page outlines the necessary hardware, software, and functional requirements for the Student
Grading System.

2|Page
System Design

The Student Grading System will be designed using object-oriented programming (OOP)
concepts in C++.

Class Diagram:

class Student {
private:
string name;
int rollNumber;
int marks[5];
float percentage;
char grade;

public:
void input();
void calculatePercentage();
void assignGrade();
void display();
void writeFile();
};

System Components:

1. Input Module: Accepts student data and marks.


2. Calculation Module: Calculates percentage and assigns grade.
3. Display Module: Shows student records.
4. File Management Module: Stores records in a file.

3|Page
Function Description

iostream: Includes input/output streams for reading and writing data to the console.
string: Includes the string class for handling text strings.
Class Definition:
 Student: Represents a student with the following private members:
 name: Stores the student's name as a string.
 marks: An array of 5 integers to store the marks for different subjects.
 totalMarks: Stores the total marks obtained by the student.
 percentage: Stores the calculated percentage of the student.
 grade: Stores the assigned grade based on the percentage.
Public Methods:
 Student(const std::string& name, const int marks[]): Constructor that initializes the name
and marks members, calculates totalMarks, percentage, and grade.
 calculatePercentageAndGrade(): Calculates the percentage based on totalMarks and
assigns the corresponding grade using a grading scale.
 display() const: Displays the student's name, total marks, percentage, and grade to the
console.
Main Function:
Creates an array of 5 Student objects with sample data for their names and marks.
Prints a header "Student Records".
Iterates over the array of students, calling the display() method for each student to print
their details.
Explanation:
 The code defines a Student class to represent individual students with their names,
marks, total marks, percentage, and grade.
 The constructor takes the student's name and an array of 5 marks as input.
 It initializes the name and marks members, calculates the totalMarks by summing
the marks, and then calls calculatePercentageAndGrade() to determine the
percentage and grade.
 The calculatePercentageAndGrade() method calculates the percentage based on the
total marks (assuming each subject is out of 100) and assigns the appropriate grade
according to a grading scale.
 The display() method prints the student's details, including name, total marks,
percentage, and grade.
 In the main function, an array of 5 Student objects is created with sample data.
 The display() method is called for each student to print their information to the
console.

4|Page
Source Code
#include <iostream>
#include <string>

class Student {
private:
std::string name;
int marks[5];
float totalMarks;
float percentage;
char grade; // Use char for grade for better readability and
efficiency

public:
void input() {
std::cout << "Enter student name: ";
std::getline(std::cin, name); // Use std::getline to read
full names with spaces
totalMarks = 0;

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


std::cout << "Enter marks for subject " << (i + 1) << ": ";
std::cin >> marks[i];
totalMarks += marks[i];
}
calculatePercentageAndGrade();
}

void calculatePercentageAndGrade() {
percentage = (totalMarks / (500.0f)) * 100; // Use 500.0f for
floating-point division
if (percentage >= 90) grade = 'A';
else if (percentage >= 80) grade = 'B';
else if (percentage >= 70) grade = 'C';
else if (percentage >= 60) grade = 'D';
else if (percentage >= 50) grade = 'E';
else grade = 'F';
}

void display() const {


std::cout << "Name: " << name
5|Page
<< ", Total Marks: " << totalMarks
<< ", Percentage: " << percentage << "%"
<< ", Grade: " << grade << "\n";
}
};

int main() {
const int studentCount = 5;
Student students[studentCount];

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

std::cout << "Entering details for student " << (i + 1) << ":\
n";

students[i].input();
}

std::cout << "\nStudent Records:\n";

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

students[i].display();
}

return 0;
}

6|Page
Output

7|Page
Conclusion

This Student Grading System effectively manages student data, calculates performance metrics,
and persists the records in a text file. The code demonstrates fundamental object-oriented
programming concepts such as encapsulation, and it includes input validation to ensure data
integrity. Future improvements could include handling more dynamic input (like variable
numbers of subjects), enhancing user experience with GUI, or implementing more detailed
reporting features.
The Student Grading System has been successfully implemented using C++ programming
language. This system:

1. Accepts student data and marks


2. Calculates percentage
3. Assigns grade
4. Displays student record
5. Writes record to file

Objectives Achieved:

1. Simplified grading process


2. Reduced manual errors
3. Provided accurate results
4. Maintained student records

Future Enhancements:

1. Expand to multiple classes/sections


2. Include additional subjects/electives
3. Implement user authentication/authorization
4. Develop graphical user interface

8|Page
References

C++ Documentation:
 The official C++ website: cplusplus.com and cppreference.com provide extensive
documentation and examples of C++ features.

Online Coding Platforms:


 Websites like GeeksforGeeks and LeetCode offer tutorials and problems that help
improve programming skills in C++.

9|Page

You might also like