Practice Assignment: Student Marks Management
Practice Assignment: Student Marks Management
Build a beginner-friendly Student Marks Management program using lists, maps/dictionaries, loops, conditions, searching, sorting, and basic calculations.
Assignment Objective
The objective of this assignment is to help students practice how to manage multiple student records using basic data structures.
In this assignment, students will create a simple Student Marks Management System that stores student details, calculates total marks, calculates average marks, assigns grades, searches records, updates marks, and displays reports.
Learning Outcomes
After completing this assignment, students will be able to:
Students Will Practice
- Creating and using lists to store multiple records.
- Using maps/dictionaries to store student details as key-value pairs.
- Adding new student records.
- Displaying all student records.
- Searching students by roll number or student ID.
- Updating marks of an existing student.
- Deleting a student record.
- Calculating total marks and average marks.
- Assigning grades based on average marks.
- Finding the highest and lowest scoring students.
- Sorting students based on marks.
- Using menu-driven programming logic.
- Applying input validation for marks and student details.
Scenario
A small coaching institute wants a simple program to manage student marks. The institute does not want to use a database yet. They want a basic program that stores student records in memory using programming data structures.
Each student record should contain basic details such as roll number, name, marks in different subjects, total marks, average marks, and grade.
Data Structure Requirement
Use a list to store multiple students.
Each student should be represented using a map/dictionary.
students = [
{
"rollNumber": 101,
"name": "Aman",
"marks": {
"programming": 85,
"database": 78,
"math": 90
}
},
{
"rollNumber": 102,
"name": "Riya",
"marks": {
"programming": 92,
"database": 88,
"math": 95
}
}
]
The exact syntax can be changed based on the programming language, but the structure should remain similar.
Required Student Fields
| Field Name | Description | Example |
|---|---|---|
| Roll Number / Student ID | Unique identifier of the student. | 101 |
| Name | Name of the student. | "Aman" |
| Programming Marks | Marks obtained in Programming subject. | 85 |
| Database Marks | Marks obtained in Database subject. | 78 |
| Math Marks | Marks obtained in Math subject. | 90 |
| Total Marks | Sum of all subject marks. | 253 |
| Average Marks | Total marks divided by number of subjects. | 84.33 |
| Grade | Grade assigned based on average marks. | "A" |
Main Program Features
Your program should provide the following menu options:
========== Student Marks Management System ==========
1. Add New Student
2. Display All Students
3. Search Student by Roll Number
4. Update Student Marks
5. Delete Student Record
6. Calculate Class Average
7. Display Topper
8. Display Lowest Scoring Student
9. Sort Students by Average Marks
10. Exit
Task 1: Add New Student
Create a feature that allows the user to add a new student record.
Requirements
- Ask the user to enter roll number.
- Ask the user to enter student name.
- Ask the user to enter marks for at least three subjects.
- Validate that marks are between
0and100. - Do not allow duplicate roll numbers.
- Store the student record in the main student list.
Suggested Pseudocode
FUNCTION addStudent()
INPUT rollNumber
CHECK if rollNumber already exists
IF rollNumber exists THEN
DISPLAY "Student already exists"
RETURN
END IF
INPUT name
INPUT programmingMarks
INPUT databaseMarks
INPUT mathMarks
VALIDATE marks
CREATE studentDictionary
ADD studentDictionary TO studentsList
DISPLAY "Student added successfully"
END FUNCTION
Task 2: Display All Students
Create a feature that displays all student records in a clean format.
Requirements
- Display roll number, name, subject marks, total marks, average marks, and grade.
- If no student records exist, display a proper message.
- Use a loop to display all records.
Sample Output
Roll No: 101
Name: Aman
Programming: 85
Database: 78
Math: 90
Total: 253
Average: 84.33
Grade: A
--------------------------------
Task 3: Search Student by Roll Number
Create a feature that searches for a student using roll number.
Requirements
- Ask the user to enter a roll number.
- Search the list of students.
- If found, display the full student record.
- If not found, display
"Student not found".
Suggested Pseudocode
FUNCTION searchStudent(rollNumber)
FOR EACH student IN studentsList
IF student["rollNumber"] == rollNumber THEN
DISPLAY student details
RETURN student
END IF
END FOR
DISPLAY "Student not found"
RETURN null
END FUNCTION
Task 4: Update Student Marks
Create a feature that updates marks of an existing student.
Requirements
- Ask the user to enter roll number.
- Search the student record.
- If found, allow the user to update subject marks.
- Validate marks before updating.
- Recalculate total, average, and grade after update.
- If not found, display a proper message.
Suggested Pseudocode
FUNCTION updateMarks()
INPUT rollNumber
student = searchStudent(rollNumber)
IF student is null THEN
DISPLAY "Cannot update. Student not found."
RETURN
END IF
INPUT newProgrammingMarks
INPUT newDatabaseMarks
INPUT newMathMarks
VALIDATE marks
UPDATE student marks
RECALCULATE total, average, grade
DISPLAY "Marks updated successfully"
END FUNCTION
Task 5: Delete Student Record
Create a feature that removes a student record using roll number.
Requirements
- Ask the user to enter roll number.
- Search for the student.
- If found, delete the student record from the list.
- If not found, display
"Student not found".
Task 6: Calculate Total, Average, and Grade
Create helper functions to calculate total marks, average marks, and grade.
Total Formula
total = programmingMarks + databaseMarks + mathMarks
Average Formula
average = total / numberOfSubjects
Grade Rules
| Average Marks | Grade |
|---|---|
90 and above |
A+ |
80 to 89 |
A |
70 to 79 |
B |
60 to 69 |
C |
50 to 59 |
D |
Below 50 |
F |
Suggested Grade Function
FUNCTION calculateGrade(average)
IF average >= 90 THEN
RETURN "A+"
ELSE IF average >= 80 THEN
RETURN "A"
ELSE IF average >= 70 THEN
RETURN "B"
ELSE IF average >= 60 THEN
RETURN "C"
ELSE IF average >= 50 THEN
RETURN "D"
ELSE
RETURN "F"
END IF
END FUNCTION
Task 7: Calculate Class Average
Create a feature that calculates the average marks of the entire class.
Requirements
- Calculate the average marks of each student.
- Add all student averages.
- Divide by total number of students.
- If no records exist, display a proper message.
classAverage = sumOfAllStudentAverages / totalStudents
Task 8: Display Topper
Create a feature that finds the student with the highest average marks.
Suggested Logic
SET topper = first student
FOR EACH student IN studentsList
IF student average > topper average THEN
SET topper = student
END IF
END FOR
DISPLAY topper details
Task 9: Display Lowest Scoring Student
Create a feature that finds the student with the lowest average marks.
Suggested Logic
SET lowestStudent = first student
FOR EACH student IN studentsList
IF student average < lowestStudent average THEN
SET lowestStudent = student
END IF
END FOR
DISPLAY lowestStudent details
Task 10: Sort Students by Average Marks
Create a feature that displays students from highest average marks to lowest average marks.
Requirements
- Sort students based on average marks.
- Display rank, roll number, name, average, and grade.
- Highest average should appear first.
Sample Rank Output
Rank Roll No Name Average Grade
1 102 Riya 91.67 A+
2 101 Aman 84.33 A
3 103 Sohan 72.00 B
Input Validation Rules
Your program should handle invalid input carefully.
Validation Requirements
- Roll number should not be empty.
- Roll number should be unique.
- Student name should not be empty.
- Marks should be numeric.
- Marks should be between
0and100. - Menu choice should be valid.
- Program should not crash if student record is not found.
Sample Initial Data
You may start your program with the following sample records:
students = [
{
"rollNumber": 101,
"name": "Aman",
"marks": {
"programming": 85,
"database": 78,
"math": 90
}
},
{
"rollNumber": 102,
"name": "Riya",
"marks": {
"programming": 92,
"database": 88,
"math": 95
}
},
{
"rollNumber": 103,
"name": "Sohan",
"marks": {
"programming": 70,
"database": 75,
"math": 71
}
}
]
Functional Requirements Checklist
| Requirement | Completed? |
|---|---|
| Add new student record | Yes / No |
| Display all student records | Yes / No |
| Search student by roll number | Yes / No |
| Update student marks | Yes / No |
| Delete student record | Yes / No |
| Calculate total and average marks | Yes / No |
| Assign grades | Yes / No |
| Find topper | Yes / No |
| Find lowest scoring student | Yes / No |
| Sort students by average marks | Yes / No |
| Apply input validation | Yes / No |
Suggested Program Structure
Students should divide the program into small functions instead of writing everything in one place.
FUNCTION addStudent()
FUNCTION displayAllStudents()
FUNCTION searchStudent(rollNumber)
FUNCTION updateStudentMarks()
FUNCTION deleteStudent()
FUNCTION calculateTotal(marks)
FUNCTION calculateAverage(total, subjectCount)
FUNCTION calculateGrade(average)
FUNCTION displayClassAverage()
FUNCTION displayTopper()
FUNCTION displayLowestScoringStudent()
FUNCTION sortStudentsByAverage()
FUNCTION showMenu()
Sample Program Flow
========== Student Marks Management System ==========
1. Add New Student
2. Display All Students
3. Search Student by Roll Number
4. Update Student Marks
5. Delete Student Record
6. Calculate Class Average
7. Display Topper
8. Display Lowest Scoring Student
9. Sort Students by Average Marks
10. Exit
Enter your choice: 1
Enter Roll Number: 104
Enter Name: Meera
Enter Programming Marks: 88
Enter Database Marks: 91
Enter Math Marks: 84
Student added successfully.
Test Cases
Test your program using the following cases.
| Test Case | Input | Expected Result |
|---|---|---|
| Add valid student | Roll: 104, valid marks | Student should be added. |
| Add duplicate roll number | Roll: 101 | Program should reject duplicate roll number. |
| Enter invalid marks | Marks: 120 | Program should show validation error. |
| Search existing student | Roll: 102 | Student details should be displayed. |
| Search missing student | Roll: 999 | Program should display student not found. |
| Update marks | Roll: 101, new marks | Marks, total, average, and grade should update. |
| Delete student | Roll: 103 | Student should be removed. |
| Display topper | Existing records | Highest average student should be displayed. |
Bonus Challenges
Students who complete the basic assignment can try the following advanced challenges.
Optional Enhancements
- Add more subjects dynamically.
- Allow searching by student name.
- Display subject-wise topper.
- Count how many students received each grade.
- Show pass/fail status.
- Allow exporting report to a text file.
- Add password-protected admin menu.
- Add validation for duplicate student names.
- Allow sorting by name, roll number, or grade.
- Create a simple report card format for each student.
Expected Deliverables
Students should submit the following:
Submission Items
- Complete source code file.
- Short explanation of the data structure used.
- Screenshot or copied output of at least three successful operations.
- Test cases used for validation.
- Brief note explaining one challenge faced and how it was solved.
Evaluation Rubric
| Criteria | Marks | Description |
|---|---|---|
| Data Structure Usage | 15 | Correct use of lists and maps/dictionaries. |
| Add, Display, Search Features | 20 | Core record management features work correctly. |
| Update and Delete Features | 15 | Records can be modified and removed properly. |
| Calculation Logic | 15 | Total, average, grade, topper, and lowest scorer are calculated correctly. |
| Input Validation | 10 | Program handles invalid input and duplicate records. |
| Program Structure | 10 | Code is divided into meaningful functions. |
| Output Formatting | 5 | Output is readable and well organized. |
| Testing and Explanation | 10 | Student provides test cases and short explanation. |
Common Mistakes to Avoid
Mistakes
- Using separate variables for every student instead of a list.
- Not checking duplicate roll numbers.
- Allowing marks below
0or above100. - Forgetting to recalculate average after updating marks.
- Searching only the first student record.
- Deleting wrong student record due to incorrect index logic.
- Writing the entire program without functions.
- Displaying unclear or incomplete output.
Better Habits
- Use one list to store all students.
- Use one map/dictionary for each student.
- Use roll number as a unique identifier.
- Validate all marks before saving.
- Use helper functions for total, average, and grade.
- Use clear function names.
- Test every menu option separately.
- Keep output readable and student-friendly.
Final Submission Checklist
Before Submission, Check That:
- The program runs without syntax errors.
- All menu options work correctly.
- Student records are stored using proper data structures.
- Duplicate roll numbers are not allowed.
- Invalid marks are rejected.
- Total, average, and grade are correct.
- Search, update, and delete features work correctly.
- Topper and lowest scoring student are displayed correctly.
- Code is properly indented and readable.
- At least three test outputs are included.
Reflection Questions
Students should answer the following questions after completing the assignment.
Why did we use a list in this project?
Because we needed to store multiple student records together.
Why did we use a map/dictionary for each student?
Because each student has multiple labeled details such as roll number, name, and marks.
Why is roll number important?
Roll number uniquely identifies each student and helps in searching, updating, and deleting records.
What happens if marks are not validated?
The program may accept invalid marks and produce incorrect total, average, grade, and report results.
How can this project be improved in the future?
It can be improved by adding file storage, database support, login system, graphical interface, and report export feature.
Quick Summary
| Concept | Use in Assignment |
|---|---|
| List | Stores multiple student records. |
| Map / Dictionary | Stores one student's details as key-value pairs. |
| Loop | Used to display, search, calculate, and sort records. |
| Condition | Used for validation, grade calculation, and decision making. |
| Function | Used to divide the program into reusable parts. |
| Searching | Used to find a student by roll number. |
| Sorting | Used to rank students by average marks. |
Final Takeaway
The Student Marks Management assignment is a practical mini project that helps students combine multiple programming concepts into one real-world system. It strengthens understanding of lists, maps/dictionaries, loops, conditions, searching, sorting, calculations, validation, and function-based program design. This assignment prepares students for larger projects such as student management systems, result processing systems, inventory systems, and database-driven applications.