Student Management System – C++ Micro Project
1. Index
1.Introduction
2.Abstraction / Objective
3.Source Code
4.Output (Sample Run)
5.Conclusion
1. P a g e
2. Introduction
The Student Management System is a simple C++ project
designed to manage student records efficiently. This project
allows users to: - Add student details (Roll No, Name, Marks)
- Display all student records - Search a student using Roll No
- Update or Delete records (optional extension) It
demonstrates the use of Classes, Objects, Arrays, Functions,
and Basic OOP Concepts in C++.
2. P a g e
3.Abstraction / Objective
- To maintain student information in a structured way. - To
provide operations like add, display, and search using OOP in
C++. - To reduce manual record-keeping. - To demonstrate file
handling (if extended version is added). Abstract Idea: This
project represents how a real-world student database system
can be simulated using basic C++ programming concepts.
3. P a g e
4.Source Code
#include<iostream> #include <string>
using namespace std;
class Student
int roll;
string name;
float marks;
public:
void input ()
cout << "\nEnter Roll No: ";
cin >> roll;
cout << "Enter Name: ";
cin.ignore();
getline(cin, name);
cout << "Enter Marks: ";
cin >> marks;
void display()
cout << "Roll: " << roll << " | Name: " << name << " | Marks: " << marks << endl;
int getRoll()
return roll;
4. P a g e
}
};
int main()
Student s [50];
int n, choice, searchRoll;
cout << "Enter number of students: ";
cin >> n;
// Taking input
for(int i=0;i<n;i++)
cout << "\n--- Student " << i+1 << " ---"; s[i].input();
do
cout << "\n===== Student Management Menu =====";
cout << "\n1. Display All Students";
cout << "\n2. Search by Roll No";
cout << "\n3. Exit";
cout << "\nEnter Choice: ";
cin >> choice;
switch(choice)
case 1:
cout << "\n--- Student Records ---\n";
for(int i=0;i<n;i++)
s[i].display();
5. P a g e
break;
case 2:
cout << "Enter Roll No to Search: ";
cin >> searchRoll;
bool found = false;
for(int i=0;i<n;i++)
if(s[i].getRoll() == searchRoll)
cout << "\nRecord Found: ";
s[i].display();
found = true;
if(!found) cout << "No student found with Roll No " << searchRoll << endl;
break;
case 3:
cout << "Exiting... Bye!\n";
break;
default:
cout << "Invalid Choice! Try again.\n";
while(choice != 3);
return 0;
6. P a g e
5.Output (Sample Run)
Enter number of students: 2
--- Student 1 ---
Enter Roll No: 101
Enter Name: Rahul Sharma
Enter Marks: 85.5
--- Student 2 ---
Enter Roll No: 102
Enter Name: Priya Verma
Enter Marks: 92.0
===== Student Management Menu =====
1. Display All Students
2. Search by Roll No
3. ExitEnter Choice: 1
--- Student Records ---
Roll: 101 | Name: Rahul Sharma | Marks: 85.5
Roll: 102 | Name: Priya Verma | Marks: 92
===== Student Management Menu =====
1. Display All Students
2. Search by Roll No
3. ExitEnter Choice: 2
Enter Roll No to Search: 101
Record Found: Roll: 101 | Name: Rahul Sharma | Marks: 85.5
===== Student Management Menu =====
1. Display All Students
2. Search by Roll No
3. ExitEnter Choice: 3 Exiting... Bye!
7. P a g e
6.Conclusion
This project successfully demonstrates a Student
Management System using C++ Object-Oriented
Programming concepts. It is simple yet effective for small
databases, and can be extended to include: - File handling for
permanent storage - Update/Delete operations - Sorting
students by marks or name
8. P a g e