Project Report
Project Report
On
Data Structures and Algorithms
Submitted By
Deepam Praveen Kumar
(01711503121) (06511503121)
Information Technology
Bharati Vidyapeeth’s College of Engineering, New Delhi – 110063, INDIA
August 2023
CANDIDATE’S DECLARATION
It is hereby certified that the work which is being presented in the B. Tech Industrial/In-house
training Report entitled “University Management System using C++” in partial fulfilment of
the requirements for the award of the degree of Bachelor of Technology and submitted in the
Department of Information Technology of BHARATI VIDYAPEETH’S COLLEGE OF
ENGINEERING, New Delhi (Affiliated to Guru Gobind Singh Indraprastha University,
Delhi) is an authentic record of our own work carried out during a period from July – August
2023 under the guidance of Dr. Surinder Kaur, Ms. Nisha Malhotra, Dr. Ajay Dureja, Ms.
Akanksha
The matter presented in the B. Tech Industrial/In-house training Report has not been submitted by
me for the award of any other degree of this or any other Institute.
This is to certify that the above statement made by the candidate is correct to the best of my knowledge. He/She/They
are permitted to appear in the External Industrial/In-house training Examination.
Trainer Name: Dr. Surinder Kaur, Ms. Nisha Malhotra, Dr. Ajay Dureja, Ms. Akanksha
S.No. Topics
1 Introduction
2 Objectives
3 Methodology
4 Project Implementation
5 Result
6
Discussion
7
Data Structure Used
8
Conclusion
9
Future Enhancements
10
References
Introduction:
University System is one of the most common and the first application implemented in
any higher educational organization.
In University, a large amount of data is processed and the results are used in running an
organization. The University management system maintains the list of colleges and their
different streams along with the examination and result department. There are menus
and sub menus in the output of the project which has given this project an organized
look.
To maintain the record of colleges, students, examination and result, the university
management department prepares the record for each department, showing the total
number of teachers and students. It also keeps track of any modification necessary
related to students and teachers, and produces regular reports for the organization giving
the total information required.
The main goal of the project is to obtain the complete and correct information. Because
University management department of an organization maintains a record of:
The Teachers
The Students
The Examination & Result
To do that, the department:
Prepares the record for each department, showing the total number of student
and teachers.
Keeps track of any modification necessary related to the students and teachers.
Produces regular reports for the Organization giving the total information
required.
Objectives
Maintaining Exam schedule like Subject code, Course, Subject Name, Date of
Examination, Time of Examination.
Methodology
PROJECT IMPLEMENTATION
Source Code
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
class Student
{
public:
int rollNumber;
string name;
string course;
int marks;
Student* next;
};
class Teacher
{
public:
int id;
string name;
string subject;
Teacher* next;
};
class ExamSchedule
{
public:
string subjectCode;
string course;
string subject;
string date;
string time;
ExamSchedule* next;
};
class UniversityManagementSystem
{
private:
Student* studentList;
Teacher* teacherList;
ExamSchedule* examScheduleList;
public:
UniversityManagementSystem()
{
studentList = nullptr;
teacherList = nullptr;
examScheduleList = nullptr;
}
if (!studentList) {
studentList = newStudent;
} else {
Student* temp = studentList;
while (temp->next) {
temp = temp->next;
}
temp->next = newStudent;
}
cout << "Student " << name << " added successfully.\n";
}
if (!current) {
std::cout << "Student with Roll Number " << rollNumber << " not
found.\n";
return;
}
if (!prev) {
// The student to be deleted is the first one
studentList = current->next;
} else {
prev->next = current->next;
}
delete current;
cout << "Student with Roll Number " << rollNumber << " deleted
successfully.\n";
}
void showStudents()
{
if (!studentList) {
std::cout << "No students found.\n";
} else {
std::cout << "Student List:\n";
Student* temp = studentList;
cout<<"Roll No."<<" "<<"name"<<" "<<"course"<<"
"<<"Marks"<<endl;
while (temp) {
cout << temp->rollNumber << " "<<temp->name <<" "<<
temp->course<<" "<<temp->marks<<endl; ;
temp = temp->next;
}
}
}
if (!teacherList) {
teacherList = newTeacher;
} else {
Teacher* temp = teacherList;
while (temp->next) {
temp = temp->next;
}
temp->next = newTeacher;
}
cout << "Teacher " << name << " added successfully.\n";
}
if (!current) {
cout << "Teacher with ID " << id << " not found.\n";
return;
}
if (!prev) {
// The teacher to be deleted is the first one
teacherList = current->next;
} else {
prev->next = current->next;
}
delete current;
cout << "Teacher with ID " << id << " deleted successfully.\n";
}
void showTeachers()
{
if (!teacherList) {
cout << "No teachers found.\n";
} else {
std::cout << "Teacher List:\n";
Teacher* temp = teacherList;
while (temp) {
std::cout << "ID: " << temp->id << "\n";
std::cout << "Name: " << temp->name << "\n";
std::cout << "Subject: " << temp->subject << "\n\n";
temp = temp->next;
}
}
}
if (!examScheduleList) {
examScheduleList = newSchedule;
} else {
ExamSchedule* temp = examScheduleList;
while (temp->next) {
temp = temp->next;
}
temp->next = newSchedule;
}
cout << "Exam schedule for " << subject << " added successfully.\n";
}
// Search for the exam schedule with the given subject code
while (current && current->subjectCode != subjectCode) {
prev = current;
current = current->next;
}
if (!current) {
cout << "Exam schedule with Subject Code " << subjectCode << " not
found.\n";
return;
}
if (!prev) {
// The exam schedule to be deleted is the first one
examScheduleList = current->next;
} else {
prev->next = current->next;
}
delete current;
cout << "Exam schedule with Subject Code " << subjectCode << "
deleted successfully.\n";
}
void showExamSchedule()
{
if (!examScheduleList) {
cout << "No exam schedules found.\n";
} else {
cout << "Exam Schedule List:\n";
ExamSchedule* temp = examScheduleList;
while (temp) {
cout << "Subject Code: " << temp->subjectCode << "\n";
cout << "Course: " << temp->course << "\n";
cout << "Subject: " << temp->subject << "\n";
cout << "Date: " << temp->date << "\n";
cout << "Time: " << temp->time << "\n\n";
temp = temp->next;
}
}
}
void sortStudentsByRollNumber()
{
if (!studentList || !studentList->next) {
// No need to sort if there are 0 or 1 students
return;
}
bool swapped;
do {
swapped = false;
Student* prev = nullptr;
Student* current = studentList;
while (current->next) {
Student* nextStudent = current->next;
if (current->rollNumber > nextStudent->rollNumber) {
// Swap current student with the next student
if (!prev) {
// Updating the head of the list
studentList = nextStudent;
} else {
prev->next = nextStudent;
}
current->next = nextStudent->next;
nextStudent->next = current;
prev = nextStudent;
swapped = true;
} else {
prev = current;
current = current->next;
}
}
} while (swapped);
void sortTeachersById()
{
if (!teacherList || !teacherList->next) {
// No need to sort if there are 0 or 1 teachers
return;
}
bool swapped;
do {
swapped = false;
Teacher* prev = nullptr;
Teacher* current = teacherList;
while (current->next) {
Teacher* nextTeacher = current->next;
if (current->id > nextTeacher->id) {
// Swap current teacher with the next teacher
if (!prev) {
// Updating the head of the list
teacherList = nextTeacher;
} else {
prev->next = nextTeacher;
}
current->next = nextTeacher->next;
nextTeacher->next = current;
prev = nextTeacher;
swapped = true;
} else {
prev = current;
current = current->next;
}
}
} while (swapped);
}
};
int main()
{
UniversityManagementSystem ums;
int choice;
while (true) {
cout << "University Management System\n";
cout << "1. Insert Student\n";
cout << "2. Delete Student\n";
cout << "3. Show Students\n";
cout << "4. Insert Teacher\n";
cout << "5. Delete Teacher\n";
cout << "6. Show Teachers\n";
cout << "7. Insert Exam Schedule\n";
cout << "8. Delete Exam Schedule\n";
cout << "9. Show Exam Schedule\n";
cout << "10. Sort Students\n";
cout << "11. Sort Teachers\n";
cout << "12. Exit\n";
cout << "Enter your choice: ";
cin >> choice;
switch (choice) {
case 1: {
int rollNumber, marks;
string name, course;
cout << "Enter Roll Number: ";
cin >> rollNumber;
cout << "Enter Name: ";
cin.ignore(); // Clear newline from previous input
getline(std::cin, name);
cout << "Enter Course: ";
getline(std::cin, course);
cout << "Enter Marks: ";
cin >> marks;
ums.insertStudent(rollNumber, name, course, marks);
break;
}
case 2: {
int rollNumber;
cout << "Enter Roll Number to delete: ";
cin >> rollNumber;
ums.deleteStudent(rollNumber);
break;
}
case 3:
ums.showStudents();
break;
case 4: {
int id;
string name, subject;
cout << "Enter ID: ";
cin >> id;
cout << "Enter Name: ";
cin.ignore();
getline(std::cin, name);
cout << "Enter Subject: ";
getline(std::cin, subject);
ums.insertTeacher(id, name, subject);
break;
}
case 5: {
int id;
cout << "Enter ID to delete: ";
cin >> id;
ums.deleteTeacher(id);
break;
}
case 6:
ums.showTeachers();
break;
case 7: {
string subjectCode, course, subject, date, time;
cout << "Enter Subject Code: ";
cin.ignore();
getline(std::cin, subjectCode);
cout << "Enter Course: ";
getline(std::cin, course);
cout << "Enter Subject: ";
getline(std::cin, subject);
cout << "Enter Date: ";
getline(std::cin, date);
cout << "Enter Time: ";
getline(std::cin, time);
ums.insertExamSchedule(subjectCode, course, subject, date, time);
break;
}
case 8: {
string subjectCode;
cout << "Enter Subject Code to delete: ";
cin.ignore();
getline(std::cin, subjectCode);
ums.deleteExamSchedule(subjectCode);
break;
}
case 9:
ums.showExamSchedule();
break;
case 10:
ums.sortStudentsByRollNumber();
break;
case 11:
ums.sortTeachersById();
break;
case 12:
cout << "Exiting...\n";
return 0;
default:
cout << "Invalid choice.\n";
}
}
return 0;
}
Output
Now as seen University Management System can easily manage data of Student,
Teacher, Examination Schedule. Now let’s reason why it so important and convenient
As we know that today is the world of computers and it has entered in the each and
every phase of everyday life. Computer plays an important role in day-to-day work.
The use of computers in the field of management of information is well known to us. The
use of computers in the university management system provides following benefits over
manual system
1.) Availability
It gives us that information which was not provided by the manual system.
2.) Timeliness
3.) Accuracy
Using computer, we will get the information more accurate rather than the manually
calculated and manual records information.
4.) Completeness
Computer never gives us incomplete information. We will always get the complete and
full information using the computer.
6.) Commensurate
The University management system processes data related with activities of students
and teachers. So university management system is very important for a university.
Needless to say, careful planning and suitable backup measures are absolutely necessary
when automating these activities. During the selection process, it is worthwhile to
review our present universities policies.
Improve benefits over before talking the whole questions of automating the process.
A good university management system will process input data faster and reduce clerical
time, while:
Linked list and Sorting is the main data structure and algorithm used in this project
to complete university management system.
Linked List - A linked list is a linear data structure, in which the elements are not stored
at contiguous memory locations. The elements in a linked list are linked using pointers
as shown in the below image:
In this program, a singly linked list is used to store data for students, teachers, and exam
schedules. A singly linked list is a data structure in which each element (node) contains
a value and a reference (a pointer) to the next element in the sequence. It allows you to
traverse the list in one direction, from the head (start) of the list to the tail (end).
The classes ‘Student’, ‘Teacher’, and ‘ExamSchedule’ represent the nodes of the linked
lists, and each node contains data relevant to students, teachers, or exam schedules,
along with a `next` pointer to the next node in the list.
Node structure for each linked list :-
Student Linked List Node (‘Student’ class):
• Data members: rollNumber, name, course, marks
• Pointer member: next (points to the next student node)
Sorting
When we have a large amount of data, it can be difficult to deal with it, especially when
it is arranged randomly. When this happens, sorting that data becomes crucial. It is
necessary to sort data in order to make searching easier.
Future Prospects
REFERENCES
Geeksforgeeks.com
Tutorialpoint.com
Javatpoint.com
Codingninjas.com