TITLE OF THE PROJECT
A Course End Project Report – PROBLEM SOLVING THROUGH ‘C’ LABORATORY (A8502)
Submitted in the Partial Fulfilment of the
Requirements
for the Award of the Degree of
BACHELOR OF TECHNOLOGY
IN
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Submitted
By
Name of the Student 23881A05XX
Under the Esteemed Guidance of
Dr. Shanthi Makka
Professor
CSE
Department of Computer Science and Engineering
VARDHAMAN COLLEGE OF ENGINEERING, HYDERABAD
(AUTONOMOUS)
Affiliated to JNTUH, Approved by AICTE, Accredited by NAAC with A++ Grade, ISO 9001:2015 Certified
Kacharam, Shamshabad, Hyderabad – 501218, Telangana, India
January, 2024
1
VARDHAMAN COLLEGE OF ENGINEERING, HYDERABAD
An autonomous institute affiliated to JNTUH
Department of Computer Science and Engineering
CERTIFICATE
This is to certify that the Course End Project titled “Title of the Project” is carried out by Mr./Ms.
X. XXXX, Roll Number 23881A05XX towards A8502 – Problem Solving Through ‘ C’
Laboratory course and submitted to Department of Computer Science and Engineering, in
partial fulfilment of the requirements for the award of degree of Bachelor of Technology in
Department of Computer Science and Engineering during the Academic year 2023-24.
Name & Signature of the Instructor
Name & Signature of the HOD
Dr. Shanthi Makka
Professor, CSE Dr. Ramesh Karnati
HOD, CSE
2
ACKNOWLEDGEMENT
The satisfaction that accompanies the successful completion of the task would be put incomplete
without the mention of the people who made it possible, whose constant guidance and
encouragement crown all the efforts with success.
We wish to express our deep sense of gratitude to Dr. Shanthi Makka, Professor, Department of
Computer Science and Engineering, Vardhaman College of Engineering, for her able guidance and
useful suggestions, which helped us in completing the design part of potential project in time.
We particularly thankful to Dr. Ramesh Karnati, Associate Professor & Head, Department of
Computer Science and Engineering for his guidance, intense support and encouragement, which
helped us to mould our project into a successful one.
We show gratitude to our honorable Principal Dr. J.V.R.Ravindra, for having provided all the
facilities and support.
We avail this opportunity to express our deep sense of gratitude and heartfelt thanks to Dr.
Teegala Vijender Reddy, Chairman and Sri Teegala Upender Reddy, Secretary of VCE, for
providing a congenial atmosphere to complete this project successfully.
We also thank all the staff members of Computer Science and Engineering for their valuable
support and generous advice. Finally, thanks to all our friends and family members for their
continuous support and enthusiastic help.
Name of the Student – 23881A05XX
3
INDEX
1. Introduction..............................................................................................................................1
2. Objective of the Project............................................................................................................2
3. Problem statement............................................................................................................pg No
4. Software and hardware requirements..............................................................................pg. no.
5. Project Description..........................................................................................................pg.no.
6. Flowchart/Algorithm/Procedure.....................................................................................pg.no
7. Code................................................................................................................................pg.no.
8. Result(s)..........................................................................................................................pg.no.
9. Conclusion and Future work..........................................................................................pg.no.
10. References......................................................................................................................pg.no.
Use Times New Roman-12 pt for report writing and First level heading 14 pt and Bold font
Results includes-Input, output and screenshots of output
4
1. Introduction
Technology has completely changed a lot of educational institutions, including how administrative
work is done and how efficient it is. The deployment of Student Database Management Systems
(DBMS) is an essential part of this change. For educational institutions, these systems are a vital
resource for managing, organizing, and storing enormous amounts of student-related data.
An extensive software program that makes it easier to organize and manage student data is called a
student database management system (SDMS). It acts as a single point of contact for a variety of
information like student demographics, grades, extracurricular activities, attendance, and academic
records. The principal aim is to optimize administrative procedures and augment decision-making
through the provision of precise and easily obtainable data.
Features and Functionalities
A student database management system has many different and complex features. They include:
Data Storage and Organization: To ensure data security and integrity, the system effectively
stores and organizes a variety of student data.
Admission and Enrollment Management: It oversees the submission of applications,
paperwork, and enrollment information.
Academic Records Management: To support academic planning and evaluation, academic
progress, courses taken, grades, and transcripts are carefully kept up to date.
Monitoring Student Attendance: Keeping tabs on student attendance facilitates the monitoring
of involvement and adherence to attendance regulations.
Communication and Reporting: Producing thorough reports to support well-informed
decision-making while fostering communication between students, instructors, and
administration.
Integration with Learning Management Systems (LMS): This feature makes it easy to access
assignments, tests, and course materials.
Security and Access Control: Protecting sensitive student data by using role-based access
control techniques to ensure data security.
Benefits and Effects
There are many benefits to putting in place a student database management system.
Efficiency and Time Savings: By streamlining procedures and reducing manual labor,
automating administrative chores saves time and money.
Data accuracy and consistency are ensured by maintaining centralized records, which reduces
data redundancy and discrepancies.
Improved Decision-Making: Educators and administrators may make well-informed choices
when they have access to real-time data.
Better Communication: Promoting efficient communication between stakeholders creates a
favorable atmosphere for learning.
5
2. Objective of the project
The objectives of this project would be centered around improving student data management within
educational institutions through the development of a simple and effective student DBMS in C:
Primary Objective:
To develop a user-friendly and flexible student database management system in C that significantly
improves the efficiency and accuracy of student data management within educational institutions.
Secondary Objectives:
To provide a user-friendly interface for adding, viewing, searching, and updating student data.
To ensure secure storage of student records with data validation to maintain data integrity.
To enable the tracking of student academic performance through features like GPA and course
information.
To generate reports for analysis and decision-making purposes.
(Optional) To implement file I/O for persistent data storage and search/sort functionalities.
To balance simplicity with desired features and functionalities, making the system accessible
and efficient for users with varying technical skill levels.
Additional Objectives:
Adapt the database structure to the unique requirements and data formats of various
educational institutions.
Use role-based access control to improve privacy and data security.
Provide systems for effective recovery procedures and frequent data backups.
Examine the possibilities for integration with different learning environments and make sure
the system can grow as the amount of data grows.
Use analytical tools to glean insights from data that has been stored, which can help you spot
patterns and opportunities for development.
By achieving these objectives, the project hopes to create a valuable tool for educational
institutions to effectively manage their student data, ultimately leading to a more efficient and
positive learning environment for all stakeholders.
Overall Impact:
To reduce time and resources spent on managing student data.
To improve access to student information for both students and staff.
To enhance the ability to track student progress and academic performance.
To streamline administrative tasks and improve decision-making processes.
To minimize the risk of errors and inconsistencies in student data.
6
3. Problem statement
Educational institutions often struggle with inefficient and disorganized student data management.
Existing systems may be paper-based, outdated software, or spreadsheets, lacking key features and
flexibility.
This leads to challenges like time-consuming data entry, difficulty in retrieving information, and
errors in record-keeping.
4. Software and Hardware requirements
Software:
Operating System: Any general-purpose operating system should suffice, such as Windows, macOS,
Linux, etc.
Development Environment: A C compiler and an Integrated Development Environment (IDE) are
necessary. Popular options include:
IDEs: Visual Studio Code, Eclipse, Code: Blocks, PyCharm (with C plugin)
Compilers: GCC, Clang, Microsoft Visual C++
Optional Software: For additional features:
Database Management System (DBMS) like SQLite or MySQL for persistent data storage.
Spreadsheet software like Microsoft Excel or LibreOffice Calc for data import/export.
Hardware:
Minimum Requirements:
Processor: Any modern processor (Intel Core i3 or equivalent) will be sufficient.
RAM: 4GB RAM or more is recommended for comfortable development and running the program.
Storage: 10GB of free disk space should be ample for the program itself and basic data storage.
Recommended Specifications:
Processor: Faster processors will improve performance, especially for larger datasets.
RAM: 8GB RAM or more for smoother multitasking and handling larger data sets.
Storage: An SSD drive will provide faster loading times and data access.
Additional Considerations:
Internet connection: If utilizing online resources like tutorials or documentation, an internet
connection is recommended.
Backup storage: For data security, it's crucial to have a backup solution like an external hard drive or
cloud storage.
Remember: These requirements are estimates and may vary depending on the specific features and
complexity of your student database management system. You can adjust them based on your project
goals and available resources.
5. Project Description
This project aims to create a simple Student Database Management System in the C programming
language. The system allows users to perform basic operations such as adding a new student,
updating student information, deleting a student, displaying the list of all students, and searching for a
student by ID or name. The data will be stored in an array of structures.
7
6. Flowchart/Algorithm/Procedure
Initialization:
Define a structure to represent a student with fields such as ID, name, age, and grade.
Declare an array to store student records.
Menu:
Display a menu with options for adding a new student, updating student information, deleting a
student, displaying all students, and searching for a student.
Add a student:
Prompt the user to enter student information (ID, name, age, grade).
Add the new student to the array of structures.
Update Student Information:
Prompt the user to enter the ID of the student to be updated.
Display the existing information and allow the user to update any field.
Delete a student:
Prompt the user to enter the ID of the student to be deleted.
Remove the student from the array.
Display All Students:
Iterate through the array and display the information of all students.
Search for a Student:
Prompt the user to enter either the ID or name of the student to be searched.
Search the array for a match and display the information if found.
Exit:
Provide an option to exit the program.
7. Code
8. #include <stdio.h>
9. #include <stdlib.h>
10. #include <string.h>
11.
12. void clearInputBuffer() {
8
13. int c;
14. while ((c = getchar()) != '\n' && c != EOF);
15. }
16. // Structure to represent a student
17. struct Student {
18. int id;
19. char name[50];
20. int age;
21. float grade;
22. };
23.
24. // Function prototypes
25. void addStudent(struct Student database[], int *count);
26. void updateStudent(struct Student database[], int count);
27. void deleteStudent(struct Student database[], int *count);
28. void displayAllStudents(struct Student database[], int count);
29. void searchStudent(struct Student database[], int count);
30.
31. int main() {
32. struct Student database[100]; // Assuming a maximum of 100 students
33. int count = 0;
34. int choice;
35.
36. do {
37. // Display menu
38. printf("\nMenu:\n");
39. printf("1. Add a Student\n");
9
40. printf("2. Update Student Information\n");
41. printf("3. Delete a Student\n");
42. printf("4. Display All Students\n");
43. printf("5. Search for a Student\n");
44. printf("6. Exit\n");
45. printf("Enter your choice: ");
46. scanf("%d", &choice);
47.
48. switch (choice) {
49. case 1:
50. addStudent(database, &count);
51. break;
52. case 2:
53. updateStudent(database, count);
54. break;
55. case 3:
56. deleteStudent(database, &count);
57. break;
58. case 4:
59. displayAllStudents(database, count);
60. break;
61. case 5:
62. searchStudent(database, count);
63. break;
64. case 6:
65. printf("Exiting the program. Goodbye!\n");
66. break;
1
0
67. default:
68. printf("Invalid choice. Please try again.\n");
69. }
70.
71. } while (choice != 6);
72.
73. return 0;
74. }
75. void addStudent(struct Student database[], int *count) {
76. // Check if there is space for a new student
77. if (*count < 100) {
78. // Prompt user for student information
79. printf("Enter student ID: ");
80. if (scanf("%d", &database[*count].id) != 1) {
81. printf("Invalid input for student ID. Please enter a valid integer.\n");
82. clearInputBuffer(); // Clear the input buffer in case of invalid input
83. return;
84. }
85.
86. clearInputBuffer(); // Clear input buffer after reading the ID
87.
88. printf("Enter student name: ");
89. fgets(database[*count].name, sizeof(database[*count].name), stdin);
90. database[*count].name[strcspn(database[*count].name, "\n")] = '\0'; // Remove the trailing
newline
91.
92. printf("Enter student age: ");
93. if (scanf("%d", &database[*count].age) != 1) {
1
1
printf("Invalid input for student age. Please enter a valid integer.\n");
94. clearInputBuffer(); // Clear the input buffer in case of invalid input
95. return;
96. }
97.
98. clearInputBuffer(); // Clear input buffer after reading the age
99.
100. printf("Enter student grade: ");
101. if (scanf("%f", &database[*count].grade) != 1) {
102. printf("Invalid input for student grade. Please enter a valid float.\n");
103. clearInputBuffer(); // Clear the input buffer in case of invalid input
104. return;
105. }
106.
107. // Increment the count
108. (*count)++;
109.
110. printf("Student added successfully!\n");
111. } else {
112. printf("Database is full. Cannot add more students.\n");
113. }
114.}
115.void updateStudent(struct Student database[], int count) {
116. // Check if there are students in the database
117. if (count > 0) {
118. int updateID;
119. int found = 0;
1
2
120.
121. // Prompt user for the ID of the student to update
122. printf("Enter the ID of the student to update: ");
123.
124. if (scanf("%d", &updateID) != 1) {
125. printf("Invalid input for student ID. Please enter a valid integer.\n");
126. clearInputBuffer(); // Clear the input buffer in case of invalid input
127. return;
128. }
129.
130. clearInputBuffer(); // Clear the input buffer after reading the ID
131.
132. // Search for the student in the database
133. for (int i = 0; i < count; i++) {
134. if (database[i].id == updateID) {
135. // Prompt user for updated information
136. printf("Enter updated name: ");
137. fgets(database[i].name, sizeof(database[i].name), stdin);
138. database[i].name[strcspn(database[i].name, "\n")] = '\0'; // Remove the trailing
newline
139.
140. printf("Enter updated age: ");
141.
142. if (scanf("%d", &database[i].age) != 1) {
143. printf("Invalid input for student age. Please enter a valid integer.\n");
144. clearInputBuffer(); // Clear the input buffer in case of invalid input
145. return;
146. }
1
3
147.
148. clearInputBuffer(); // Clear the input buffer after reading the age
149.
150. printf("Enter updated grade: ");
151.
152. if (scanf("%f", &database[i].grade) != 1) {
153. printf("Invalid input for student grade. Please enter a valid float.\n");
154. clearInputBuffer(); // Clear the input buffer in case of invalid input
155. return;
156. }
157.
158. printf("Student information updated successfully!\n");
159. found = 1;
160. break;
161. }
162. }
163.
164. if (!found) {
165. printf("Student not found in the database.\n");
166. }
167. } else {
168. printf("No students in the database. Cannot update.\n");
169. }
170.}
171.void deleteStudent(struct Student database[], int *count) {
172. // Check if there are students in the database
173. if (*count > 0) {
1
4
174. int deleteID;
175. int found = 0;
176.
177. // Prompt user for the ID of the student to delete
178. printf("Enter the ID of the student to delete: ");
179.
180. if (scanf("%d", &deleteID) != 1) {
181. printf("Invalid input for student ID. Please enter a valid integer.\n");
182. clearInputBuffer(); // Clear the input buffer in case of invalid input
183. return;
184. }
185.
186. clearInputBuffer(); // Clear the input buffer after reading the ID
187.
188. // Search for the student in the database
189. for (int i = 0; i < *count; i++) {
190. if (database[i].id == deleteID) {
191. // Shift remaining elements to fill the gap
192. for (int j = i; j < (*count - 1); j++) {
193. database[j] = database[j + 1];
194. }
195.
196. // Decrement the count
197. (*count)--;
198.
199. printf("Student deleted successfully!\n");
200. found = 1;
1
5
201. break;
202. }
203. }
204.
205. if (!found) {
206. printf("Student not found in the database.\n");
207. }
208. } else {
209. printf("No students in the database. Cannot delete.\n");
210. }
211.}
212.void displayAllStudents(struct Student database[], int count) {
213. // Check if there are students in the database
214. if (count > 0) {
215. // Display header
216. printf("%-5s%-20s%-5s%-7s\n", "ID", "Name", "Age", "Grade");
217.
218. // Display each student's information
219. for (int i = 0; i < count; i++) {
220. printf("%-5d%-20s%-5d%-7.2f\n", database[i].id, database[i].name, database[i].age,
database[i].grade);
221. }
222. } else {
223. printf("No students in the database.\n");
224. }
225.}
226.
227.void searchStudent(struct Student database[], int count) {
1
6
228. // Check if there are students in the database
229. if (count > 0) {
230. int searchID;
231. char searchName[50];
232. int found = 0;
233.
234. // Prompt user for search criteria
235. printf("Enter the ID or name of the student to search: ");
236. scanf("%d", &searchID);
237. scanf("%s", searchName);
238.
239. // Search for the student in the database
240. for (int i = 0; i < count; i++) {
241. if (database[i].id == searchID || strcmp(database[i].name, searchName) == 0) {
242. // Display the student's information
243. printf("%-5s%-20s%-5s%-7s\n", "ID", "Name", "Age", "Grade");
244. printf("%-5d%-20s%-5d%-7.2f\n", database[i].id, database[i].name, database[i].age,
database[i].grade);
245. found = 1;
246. break;
247. }
248. }
249.
250. if (!found) {
251. printf("Student not found in the database.\n");
252. }
253. } else {
254. printf("No students in the database. Cannot search.\n");
1
7
255. }
256.}
257.
8. Results
Menu:
1. Add a Student
2. Update Student Information
3. Delete a Student
4. Display All Students
5. Search for a Student
6. Exit
Enter your choice: 1
Enter student ID: 2399881A05XX
Enter student name: Bhukya Praveen
Enter student age: 19
Enter student grade: 9.2
Student added successfully!
Menu:
1. Add a Student
2. Update Student Information
3. Delete a Student
4. Display All Students
5. Search for a Student
6. Exit
Enter your choice: 4
ID Name Age Grade
23881A05XX Bhukya Praveen 19 9.20
Menu:
1. Add a Student
2. Update Student Information
3. Delete a Student
4. Display All Students
5. Search for a Student
6. Exit
Enter your choice: 2
Enter the ID of the student to update: 23881A05XX
Enter updated name: Praveen
Enter updated age: 18
Enter updated grade: 9.5
Student information updated successfully!
1
8
Menu:
1. Add a Student
2. Update Student Information
3. Delete a Student
4. Display All Students
5. Search for a Student
6. Exit
Enter your choice: 5
Enter the ID or name of the student to search: 238981A05XX
ID Name Age Grade
23881A05XX Praveen 18 9.50
Menu:
1. Add a Student
2. Update Student Information
3. Delete a Student
4. Display All Students
5. Search for a Student
6. Exit
Enter your choice: 3
Enter the ID of the student to delete: 23881A05XX
Student deleted successfully!
Menu:
1. Add a Student
2. Update Student Information
3. Delete a Student
4. Display All Students
5. Search for a Student
6. Exit
Enter your choice: 4
No students in the database.
Menu:
1. Add a Student
2. Update Student Information
3. Delete a Student
4. Display All Students
5. Search for a Student
6. Exit
Enter your choice: 6
Exiting the program. Goodbye!
9. Conclusions and Future Work
10. References
1
9