Cse PR
Cse PR
Project Report
Course Title: Data Structure Lab
Course Code: CSE 105
Section: DA
Student Data
NAME: MD SAKIB HASAN EMON
Student ID: 222902026
Department of CSE (PC)
Green University of Bangladesh
Teachers Evolution
Teacher’s Name:
Submission Date:
Signature:
Marks:
Table of Contents
Chapter 1 Introduction....................................................................................................................................
1.1 Introduction...............................................................................................................................................
1.2 Design Goals/Objective............................................................................................................................
Chapter 4 Conclusion......................................................................................................................................
4.1 Introduction...............................................................................................................................................
4.1 Practical Implications................................................................................................................................
4.2 Scope of Future Work...............................................................................................................................
References.........................................................................................................................................................
1.1 Introduction:
The Student Management System is a software application designed to streamline and
automate various administrative tasks related to student information in educational
institutions. It serves as a centralized platform to manage student records, academic
performance, attendance, and other relevant data. The system aims to improve
efficiency, organization, and communication within the institution, benefiting both
students and administrators.
1.2 Objective:
The objective of the STUDENT MANAGEMENT SYSTEM project is to create an
efficient and comprehensive system that streamlines the management of student-related
tasks in an educational institution. The system aims to automate processes such as
student enrollment, data entry, student details etc. By implementing this system, the
project seeks to enhance administrative productivity, improve data accuracy, and provide
a user-friendly interface for all stakeholders. The goal is to enhance the overall
efficiency and effectiveness of student management, leading to better student outcomes
and an enhanced educational experience for all parties involved.
2.1 Design/Development:
2.2 Implementation of the Project:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
char name[MAX_NAME_LENGTH];
char phoneNumber[MAX_NAME_LENGTH];
char department[MAX_DEPARTMENT_LENGTH];
int id;
} Student;
Student students[MAX_STUDENTS];
int studentCount = 0;
void insertStudent();
void deleteStudent();
void searchStudent();
void viewStudents();
void sortStudents();
void sortByName();
void sortByDepartment();
void sortByID();
void showTotalStudents();
void searchByDepartment();
void searchByID();
int validatePassword();
int main() {
int choice;
int attempts = 3;
int loggedIn = 0;
while (1) {
printf("------------------------------------------\n");
printf("\tStudent Management System\n\n");
printf("\t@Designed by Sakib\n");
printf("-----------------------------------------\n\n");
if (!loggedIn) {
if (attempts <= 0) {
printf("Too many incorrect attempts. Exiting...\
n");
exit(0);
}
if (!validatePassword()) {
attempts--;
continue;
}
loggedIn = 1;
}
printf("\t\t1. Insert\n");
printf("\t\t2. Delete\n");
printf("\t\t3. Search\n");
printf("\t\t4. View\n");
printf("\t\t5. Exit\n");
printf("\t\tEnter your choice: ");
scanf("%d", &choice);
switch (choice) {
case 1:
insertStudent();
break;
case 2:
deleteStudent();
break;
case 3:
searchStudent();
break;
case 4:
viewStudents();
break;
case 5:
exit(0);
default:
printf("Invalid choice! Please try again.\n");
}
}
return 0;
}
void insertStudent() {
if (studentCount == MAX_STUDENTS) {
printf("Cannot add more students. The database is full.\
n");
return;
}
Student newStudent;
printf("Enter student name: ");
scanf("%s", newStudent.name);
printf("Enter phone number: ");
scanf("%s", newStudent.phoneNumber);
printf("Enter department: ");
scanf("%s", newStudent.department);
printf("Enter ID: ");
scanf("%d", &newStudent.id);
students[studentCount++] = newStudent;
printf("Student inserted successfully.\n");
}
void deleteStudent() {
int id, i;
printf("Enter the ID of the student to delete: ");
scanf("%d", &id);
if (i == studentCount) {
printf("Student with ID %d not found.\n", id);
} else {
for (; i < studentCount - 1; i++) {
students[i] = students[i + 1];
}
studentCount--;
printf("Student with ID %d deleted successfully.\n",
id);
}
}
void searchStudent() {
int id, i;
printf("Enter the ID of the student to search: ");
scanf("%d", &id);
void viewStudents() {
int choice;
printf("View Options:\n");
printf("1. Sort by Name\n");
printf("2. Sort by Department\n");
printf("3. Sort by ID\n");
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice) {
case 1:
sortByName();
break;
case 2:
sortByDepartment();
break;
case 3:
sortByID();
break;
default:
printf("Invalid choice! Displaying unsorted list.\
n");
}
printf("Name\t\tPhone Number\t\tDepartment\t\tID\n");
for (int i = 0; i < studentCount; i++) {
printf("%s\t\t%s\t\t%s\t\t\t%d\n", students[i].name,
students[i].phoneNumber, students[i].department,
students[i].id);
}
}
void sortByName() {
for (int i = 0; i < studentCount - 1; i++) {
for (int j = 0; j < studentCount - i - 1; j++) {
if (strcmp(students[j].name, students[j + 1].name) >
0) {
// Swap students
Student temp = students[j];
students[j] = students[j + 1];
students[j + 1] = temp;
}
}
}
}
void sortByDepartment() {
for (int i = 0; i < studentCount - 1; i++) {
int minIndex = i;
for (int j = i + 1; j < studentCount; j++) {
if (strcmp(students[j].department,
students[minIndex].department) < 0) {
minIndex = j;
}
}
Student temp = students[i];
students[i] = students[minIndex];
students[minIndex] = temp;
}
}
void sortByID() {
for (int i = 1; i < studentCount; i++) {
Student key = students[i];
int j = i - 1;
while (j >= 0 && students[j].id > key.id) {
students[j + 1] = students[j];
j--;
}
students[j + 1] = key;
}
}
void showTotalStudents() {
printf("Total number of students: %d\n", studentCount);
}
void searchByDepartment() {
char department[MAX_DEPARTMENT_LENGTH];
printf("Enter the department to search for: ");
scanf("%s", department);
int validatePassword() {
char password[MAX_NAME_LENGTH];
printf("Enter the password: ");
scanf("%s", password);
if (strcmp(password, PASSWORD) == 0) {
return 1;
}
2. Create a new C file and copy the code of the student management system into the file.
3. Compile the code using the C compiler or IDE. Ensure that there are no syntax errors or
warnings.
5. The program will display a menu of options for managing student records.
6. Enter the corresponding number for the operation you want to perform:
- 1: Insert a new student record. Provide the name, roll number, and marks of the student as
prompted.
- 2: Delete a student record. Enter the roll number of the student to be deleted.
- 3: Search for a student record. Enter the id number of the student you want to find.
- 4: View all student records.
- 5: Exit the program.
7. Based on your choice, the program will execute the corresponding operation and display
the result or perform the desired action.
8. After completing the selected operation, the program will display the menu again,
allowing you to choose another option or exit the program.
10. Once you are done, choose the "6" option to exit the program.
This simulation procedure will allow you to interact with the student management system
project in C and perform operations such as inserting, deleting, searching, viewing, and
sorting student records.
By implementing this system, users can easily insert new student records, delete existing
records, search for specific students by their roll numbers, view all student records, and sort
the records by roll number. The program efficiently handles these operations by using data
structures and algorithms in C.
The project offers a user-friendly interface that allows users to interact with the system
seamlessly. It provides real-time feedback and notifications regarding the success or failure
of operations, ensuring a smooth user experience.
The sorting functionality enables users to arrange the student records in ascending order
based on roll numbers, facilitating easy access to information. This feature improves the
system's usability and efficiency, especially when dealing with large datasets.
Overall, the student management system project in C is a valuable tool for educational
institutions and organizations to effectively manage and organize student records,
simplifying administrative tasks and enhancing productivity.
4 .1 Conclusion:
In conclusion, the student management system project in C provides a basic yet effective
way to manage student records. The program allows users to insert, delete, search, and view
student details. It also includes the functionality to sort the records by roll number. With the
ability to handle multiple student entries, the system offers convenient management and
organization of student data. It serves as a useful tool for educational institutions or any
scenario that requires the management of student information. The project demonstrates the
fundamental concepts of data manipulation and user interaction in C programming,
contributing to a well-rounded understanding of the language.
References:
1. Bala Guruswamy, E. (2019). Programming in ANSI C. McGraw Hill Education.
2. Kernighan, B. W., & Ritchie, D. M. (1988). The C Programming Language (2nd Edition).
Prentice Hall.
3. Gottschling, P. (2015). Discovering Modern C++: An Intensive Course for Scientists,
Engineers, and Programmers. Addison-Wesley Professional.
4. "C Programming Language" - Wikipedia. [Online]. Available:
https://en.wikipedia.org/wiki/C_(programming_language)
5. "C Standard Library" - Wikipedia. [Online]. Available:
https://en.wikipedia.org/wiki/C_standard_library
6. Google.