Develop a simple command-line application to manage student records using C++ programming language. The application should allow users to perform basic operations, such as adding students, viewing student information, and listing all students. You need to create classes and methods to implement this functionality. Requirements:
-
Create a Student class with the following attributes:
Student ID (int)
Name (String)
Age (int)
Grade (double) -
Create a StudentManagementSystem class to manage student records. This class should include the following methods:
addStudent(Student student): Add a new student to the system.
getStudent(int studentID): Retrieve and display the information of a student by their ID.
listAllStudents(): List all students in the system with their ID, name, age, and grade. -
Implement a simple command-line interface to interact with the system. You should provide options to:
Add a new student (prompt for ID, name, age, and grade).
View a student's information by entering their ID.
List all students.
Exit the application. -
Constraints:
Each student's ID is unique, and there can be multiple students with the same name.
Age should be a positive integer.
Grade should be a double between 0.0 and 4.0.
Check out the Solution of the problem in CPP by clicking here
Once the code in CPP is created to execute it on Command Prompt, the following steps are used:
Step 1: Open the Command Prompt
Step 2: Navigate to the directory
cd C:\Users\ramya\Documents
Step 3: Compile the C++ program
g++ -o output Student_Management_System
Step 4: Run the Executable
output.exe
Step 5: Check the output
The output of the program will be displayed in the command prompt
Inputs |
---|
![]() |
Viewing details of a student |
---|
![]() |
Listing out all the students details |
---|
![]() |
Checking the uniqueness of student id |
---|
![]() |
Checking the age constraint of the student |
---|
![]() |
Checking the grade constraint of the student |
---|
![]() |
1.CPP
2.Command Prompt