Python Assignment 2 – Advanced Level
Total Marks: 100
Submission: .py file + screenshot of output
Deadline: 3 days
Project Title:
“Student Course Management System”
Objective:
To design a mini-application that allows users to add, view, and search student records using
GUI and database concepts.
Assignment Structure
Part A: Object-Oriented Programming (20 Marks)
• Create a Student class with attributes:
roll_no, name, course, fees
• Include methods to:
o Display student details
o Return student data in dictionary format
python
class Student:
def __init__(self, roll_no, name, course, fees):
# initialize
def show_details(self):
# display details
Part B: SQLite3 Database (20 Marks)
• Create a database student.db
• Table: students (roll_no TEXT PRIMARY KEY, name TEXT, course TEXT, fees INTEGER)
• Write functions to:
o Insert new student record
o Fetch all records
o Search by roll number
Part C: File Handling (10 Marks)
• Save each new student’s details to a text file students_log.txt in this format:
Roll No: 101 | Name: Rahul | Course: Python | Fees: 8000
Part D: Tkinter GUI (30 Marks)
Build a basic interface with the following:
• Input Fields: Roll No, Name, Course, Fees
• Buttons:
o Add Student: Adds data to DB + text file
o View All: Shows all data in text area or messagebox
o Search: Enter Roll No and get full details
Part E: Exception Handling & Logic (10 Marks)
• Use try-except to handle duplicate roll numbers, empty fields, or DB errors gracefully.
Bonus (10 Marks)
• Use Numpy to calculate and display the average fees of all students.
• Display result in GUI or terminal.
import numpy as np
fees = [8000, 10000, 9000]
avg = np.mean(fees)
Sample GUI Preview (optional for guidance only)
+--------------------------------+
| Roll No: [__________] |
| Name: [__________] |
| Course: [__________] |
| Fees: [__________] |
| |
| [Add Student] [Search] [View] |
+--------------------------------+
Submission Checklist
• Python script file (student_app.py)
• student.db SQLite file
• students_log.txt file
• Screenshot(s) of output and working GUI
Skills Tested
• OOP & constructor
• Tkinter GUI building
• SQLite3 database operations
• File handling
• Logical problem-solving
• Use of external module (NumPy)