Program11

11. Develop Student Grade Tracker: Accept multiple students’ names and marks. Store them in a list of tuples or dictionaries. Display summary reports (average, topper, etc.).

Objective of the Program

  • To understand list of dictionaries / tuples

  • To store structured data

  • To perform aggregate calculations

  • To generate summary reports

  • To practice real-world data handling


Logical Construction (Think Before You Code)

Suppose input is:

NameMarks
Rahul85
Sneha92
Arjun78

We must:

  1. Store data properly

  2. Compute:

    • Average

    • Maximum

    • Minimum

  3. Identify topper

  4. Display formatted output


Data Structure Choice

We will use list of dictionaries:

[

 {'name': 'Rahul', 'marks': 85},

 {'name': 'Sneha', 'marks': 92}

]

Why dictionary?

  • Easy to access by key

  • More readable

  • Better than tuple for beginners


πŸ‘‰ Key Idea:

Store → Process → Report


Flowchart (Block Diagram of Logic)


Flowchart Explanation
  • Start

  • Read number of students

  • Loop to read name and marks

  • Store in list

  • Calculate total marks

  • Find highest & lowest

  • Compute average

  • Display summary

  • Stop


Algorithm

  1. Start

  2. Read number of students

  3. Initialize empty list

  4. For each student:

    • Read name

    • Read marks

    • Store as dictionary in list

  5. Calculate total marks

  6. Compute average

  7. Find student with maximum marks

  8. Find student with minimum marks

  9. Display summary report

  10. Stop


Python Program (With Gaps for Students)

⚠ Students must complete missing parts.

# Student Grade Tracker


n = int(input("Enter number of students: "))


students = []


for i in range(n):

    name = input("Enter student name: ")

    marks = float(input("Enter marks: "))

    students.append({"name": ____________, "marks": ____________})


total = 0


for student in students:

    total += student["__________"]


average = total / ____________


topper = students[0]

lowest = students[0]


for student in students:

    if student["marks"] > topper["marks"]:

        topper = student

    

    if student["marks"] < ____________:

        lowest = student


print("\n----- Summary Report -----")

print("Average Marks:", average)

print("Topper:", topper["name"], "-", topper["marks"])

print("Lowest Scorer:", lowest["name"], "-", lowest["marks"])


print("\nComplete Student Report:")

for student in students:

    print(student["name"], ":", student["marks"])



Probable Output

Enter number of students: 3
Enter student name: Rahul
Enter marks: 85
Enter student name: Sneha
Enter marks: 92
Enter student name: Arjun
Enter marks: 78

----- Summary Report -----
Average Marks: 85.0
Topper: Sneha - 92.0
Lowest Scorer: Arjun - 78.0

Complete Student Report:
Rahul : 85.0
Sneha : 92.0
Arjun : 78.0

Important Concepts Used

  • List of dictionaries

  • Looping

  • Aggregation

  • Conditional comparison

  • Basic reporting logic


Viva Voce Questions

  1. What is list of dictionaries?

  2. Why use dictionary instead of tuple?

  3. How do we calculate average?

  4. How do we find topper?

  5. What happens if two students have same highest marks?

  6. Can this be extended to multiple subjects?

  7. What is time complexity?


Procedure to Execute the Program

  1. Open Python IDE

  2. Create new file

  3. Type program

  4. Save as .py

  5. Run program

  6. Enter number of students

  7. Enter names and marks


Google Colab – Online Execution

πŸ‘‰ Paste Colab link here.

[ https://colab.research.google.com/drive/1uGwQqZz4JgYOZuS8ruYfqyeH95OIH-gv?usp=sharing ]


Program Explanation



Assignment for Students

  • Add grade classification (A, B, C)

  • Sort students by marks

  • Store data in CSV file

  • Add subject-wise marks



Lab Record Instructions

Right Side of the Record
1. Problem Statement
2. Python Program
Write the following neatly on the right-hand side page:

Left Side of the Record
3. Flowchart
4. Algorithm
5. Output
⚠️ Students must write ALL possible outputs.
Write the following neatly on the left-hand side page:



-:END:-



Comments

Popular posts from this blog