Fop Project

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 4

Sure! How about creating a simple student management system in C++?

This project will allow you to


practice and showcase your knowledge of switch statements, functions, arrays, structures, pointers,
object-oriented programming (OOP), classes, objects, and file handling. Here's an outline for the project:

Student Management System

1. Create a Student Class:

Define a class called "Student" that represents a student's information.

The student class should have the following data members:

Name (string)

Roll number (int)

Marks (array of float to store marks of different subjects)

Include member functions to set and get student information.

Include a function to calculate the average marks of the student.

2. Main Function:

In the main function, create an array of "Student" objects to store multiple students' data.

Use switch statements to provide a menu-driven interface to perform various operations:

Add a new student and input their details (name, roll number, and marks for each subject).

Display information of a specific student based on the roll number.

Display the average marks of a specific student.

Display the average marks of all students.

Save the student data to a text file.

Load the student data from the text file.

Exit the program.


3. File Handling:

Implement functions to save student data to a text file and load data from the text file.

When saving to the text file, store each student's information on a separate line with appropriate
delimiters to distinguish between fields (e.g., name, roll number, and marks).

4. Additional Features (Optional):

You can add more features to enhance the project, such as searching for a student based on name or roll
number, displaying the highest/lowest marks, etc.

Example of How the Program Should Run:

yaml

Copy code

1. Add a new student

2. Display student information

3. Display average marks of a student

4. Display average marks of all students

5. Save student data to file

6. Load student data from file

7. Exit

Enter your choice: 1

Enter student name: John Doe

Enter roll number: 1001

Enter marks for each subject:


Maths: 85

Science: 78

English: 92

Student added successfully!

Enter your choice: 2

Enter roll number to display student information: 1001

Name: John Doe

Roll Number: 1001

Marks:

Maths: 85

Science: 78

English: 92

Enter your choice: 3

Enter roll number to display average marks: 1001

Average marks for John Doe (Roll Number 1001): 85

Enter your choice: 4


Average marks of all students:

John Doe (Roll Number 1001): 85

Enter your choice: 5

Student data saved to file successfully!

Enter your choice: 6

Student data loaded from file successfully!

Enter your choice: 7

Exiting the program...

Remember, this is just a basic outline, and you can add more complexity and features to make it even
more engaging and practical. Happy codind.

You might also like