Student Data Management System
Student Data Management System
SUBMITTED TO:
SUBMITTED BY:
STUDENT DATA MANAGEMENT SYSTEM
Introduction:
The Student Data Management System is a C++ console application designed to facilitate the
organization and manipulation of student information. The project is structured around classes
such as Student, Node, and StudentList, utilizing linked lists for efficient data management.
The system features a menu-driven interface to perform tasks like inserting, searching, deleting,
and analyzing student data.
2.Node Class:
Attributes:
data: Student object containing student information.
next: Pointer to the next node in the linked list.
Methods:
Node: Constructor for initializing a node with student data.
3.StudentList Class:
Attributes:
head: Pointer to the first node in the linked list.
Methods:
displayMenu: Displays the menu of available operations.
insertStudent: Inserts a new student into the linked list.
searchAndInsert: Searches for a specific roll number and inserts new data
after it.
deleteStudent: Deletes a student with a specified roll number.
calculateMarksAndGrade: Calculates marks and assigns a grade for a
specific roll number.
calculateClassStats: Calculates statistics for the entire class.
displayStudentTable: Displays a table of student information.
clearScreen: Clears the console screen.
Features:
1.Insert Student Data:
Allows the user to input student details and inserts the student into the list.
2.Search and Insert Data:
Searches for a specified roll number and inserts new data after it.
3.Delete Student Data:
Deletes a student with a specified roll number from the list.
4.Calculate Marks and Grade:
Calculates the total marks and assigns a grade for a specified roll number.
5.Calculate Class Stats:
Calculates statistics for the entire class, including total students, class percentage, and the
number of students passed or failed.
6.Display Student Table:
Displays a tabular representation of student information, including roll number, name,
percentage, and grade.
7.User-Friendly Interface:
Presents a menu-driven interface for users to interact with the system easily.
Conclusion:
The Student Data Management System demonstrates an effective approach to handling student
information in a user-friendly manner. Leveraging linked lists and a menu-driven interface, the
program provides a versatile and accessible platform for managing academic records. While
ensuring data accuracy and preventing duplicates, the system caters to the diverse needs of users
involved in student data management.
Code:
// project.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
class Student {
public:
int rollNo;
string name;
string department;
string subjects[4]; // Array for 4 subjects
float marks[4]; // Assuming 4 subjects
char grade;
Student(int roll, const string& n, const string& dept, const string& sub1, const string& sub2,
const string& sub3, const string& sub4)
: rollNo(roll), name(n), department(dept), grade(' ') {
subjects[0] = sub1;
subjects[1] = sub2;
subjects[2] = sub3;
subjects[3] = sub4;
class Node {
public:
Student data;
Node* next;
class StudentList {
private:
Node* head;
public:
StudentList() : head(nullptr) {}
void displayMenu() {
}
void insertStudent(const Student& newStudent) {
Node* newNode = new Node(newStudent);
newNode->next = current->next;
current->next = newNode;
// Find the node with the given searchRollNo or the position to insert
while (current && current->data.rollNo < searchRollNo) {
prev = current;
current = current->next;
}
if (head->data.rollNo == rollNo) {
Node* temp = head;
head = head->next;
delete temp;
cout << "Student with Roll No " << rollNo << " deleted.\n";
cout<<endl;
return;
}
if (current->next) {
Node* temp = current->next;
current->next = current->next->next;
delete temp;
cout<<endl;
cout << "Student with Roll No " << rollNo << " deleted.\n";
cout<<endl;
} else {
cout<<endl;
cout << "Student with Roll No " << rollNo << " not found. Nothing deleted.\n";
cout<<endl;
}
}
if (current) {
// Perform calculations and display student data
int totalMarks = 0; // Initialize total marks
totalMarks += current->data.marks[i];
}
void calculateClassStats() {
if (!head) {
cout << "Class is empty. No statistics to calculate.\n";
return;
}
int totalStudents = 0;
int passCount = 0;
int failCount = 0;
current = current->next;
}
void displayStudentTable() {
if (!head) {
cout << "Class is empty. No students to display.\n";
return;
}
float percentage = (totalMarks / 200) * 100; // Assuming total marks for 4 subjects is 200
cout << "| " << setw(10) << current->data.rollNo << " | " << setw(20) << current-
>data.name
<< " | " << fixed << setprecision(2) << setw(13) << percentage << " | " << setw(6) <<
current->data.grade << " |\n";
current = current->next;
}
cout << "+------------+----------------------+---------------+--------+\n";
}
};
void clearScreen() {
system("cls");
}
int _tmain(int argc, _TCHAR* argv[]) {
StudentList studentList;
while (true) {
studentList.displayMenu();
int choice;
cin >> choice;
switch (choice) {
case 1: {
clearScreen();
int rollNo;
string name, department, subjects[4];
cout << "Enter Roll No: ";
cin >> rollNo;
cout << "Enter Name: ";
cin.ignore();
getline(cin, name);
cout << "Enter Department: ";
getline(cin, department);
cout << "-- Enter Subjects --\n";
for (int i = 0; i < 4; ++i) {
cout << "Enter subject " << (i + 1) << ": ";
cin >> subjects[i];
}
Student newStudent(rollNo, name, department, subjects[0], subjects[1], subjects[2],
subjects[3]);
studentList.insertStudent(newStudent);
break;
}
case 2: {
clearScreen();
int searchRollNo;
cout << "Enter Roll No after which you want to add data: ";
cin >> searchRollNo;
int rollNo;
string name, department, subjects[4];
studentList.deleteStudent(rollNoToDelete);
break;
}
case 4: {
clearScreen();
int rollNoToCalculate;
cout << "Enter Roll No to calculate marks and grade: ";
cin >> rollNoToCalculate;
cout<<endl;
studentList.calculateMarksAndGrade(rollNoToCalculate);
break;
}
case 5:
clearScreen();
studentList.calculateClassStats();
break;
case 6:
clearScreen();
studentList.displayStudentTable();
break;
case 7:
clearScreen();
cout << "Exiting program. Goodbye!\n";
return 0;
default:
clearScreen();
cout << "Invalid choice. Please try again.\n";
}
}
system("pause");
return 0;
}
Output:
Inserting Choice 1:
Entering choice 2:
Entering choice 3:
Entering Choice 4:
Entering Choice 5:
Entering Choice 6: