0% found this document useful (0 votes)
24 views8 pages

Cs Project Completed

The document outlines a student management system that uses a dictionary to store student records, allowing users to add, view, edit, delete, and display student information through a main menu interface. It includes error handling to ensure valid inputs and suggests improvements for input validation and user experience. Additionally, it features a certificate of completion for a project by Akshat Aggarwal and acknowledges the support of mentors and family.

Uploaded by

Akshat Aggarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views8 pages

Cs Project Completed

The document outlines a student management system that uses a dictionary to store student records, allowing users to add, view, edit, delete, and display student information through a main menu interface. It includes error handling to ensure valid inputs and suggests improvements for input validation and user experience. Additionally, it features a certificate of completion for a project by Akshat Aggarwal and acknowledges the support of mentors and family.

Uploaded by

Akshat Aggarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 8

Summary of Working

1) Data Structure
 Uses a dictionary called students to store student records.
 Each student is stored with their Roll Number as the key and their details (Name, Class,
Section, Admission Number) as the values in a nested dictionary.
2) Main Menu Loop
 The program runs continuously until the user chooses to exit (option 6).
 It displays 6 options for user interaction, allowing the user to manage student records.
 Uses input () to get the user's choice and performs the corresponding operation.
3) Key Functions
Add Student (Option 1):
 Prompts the user to enter the student’s Roll Number, Name, Class, Section, and Admission
Number.
 The entered data is stored in the student dictionary.
 Ensures the data is entered correctly and adds the student to the system.
View Students (Option 2):
 Displays all student records stored in the system.
 If there are no students in the system, a message is shown stating "No students found."
Edit Student (Option 3):
 Prompts the user to enter the Roll Number of the student to edit.
 If the student exists, the program allows the user to update the student’s details (Name,
Class, Section, Admission Number).
 If a field is left blank, it retains the current value.
Delete Student (Option 4):
 Prompts the user to enter the Roll Number of the student to delete.
 If the student exists in the dictionary, it deletes the student's record.
 Displays a confirmation message if the student is deleted successfully.
Display All Students (Option 5):
 Lists all students with their details in a formatted way.
 If no students exist, a message is displayed: "No students to display."
Exit (Option 6):
 Ends the program by breaking out of the main loop and displaying an exit message.
4) Error Handling
 Ensures the user enters a valid choice from the available options.
 Checks whether the entered Roll Number exists when editing or deleting a student.
 Displays appropriate messages when the Roll Number is not found or if an invalid choice is
made.
 The program doesn't allow users to overwrite student records without providing valid input.
5) Improvements
Input Validation:
 Ensure that Roll Numbers are valid and unique.
 Ensure that user inputs for fields like Name, Class, Section, and Admission Number are
properly formatted.
Additional Features:
 Add functionality to sort students based on class or section.
 Allow partial search functionality, so users can search for students by name or admission
number.
 Add a feature to list students who have been added in the past week, month, etc.
Error Handling:
 Use try-except blocks to handle any invalid input errors gracefully.
 Add confirmation prompts before deletion to prevent accidental deletions.
User Experience:
 Improve the menu display formatting for better readability.
 Include a confirmation message upon exiting the program, so the user knows the action was
completed successfully.
Conclusion:
This student management system effectively manages student records, and with the suggested
improvements, it can become a more robust and user-friendly application.

CERTIFICATE OF COMPLETION
This is to certify that the Project titled School Database , Computer Science, is a bonafide work
carried out and successfully completed by Akshat Aggarwal of class 11 A The Indian School, New
Delhi, for the fulfilment of Project Work.

Teacher Guide
(Ms. Simranjeet Kaur)

ACKNOWLEDGEMENTS
A project is a golden opportunity for learning and self-development. I consider
myself fortunate and privileged to have such wonderful mentors guide me
through the journey to the completion of the project.

My sincere thanks to Ms Tania Joshi, Principal, The Indian School, New Delhi,
for always encouraging me to put forth my best.

My heartfelt gratitude to my Teacher Guide, Ms Simranjeet Kaur, for her


patience and belief in me. Her exemplary investment in the complete process,
constant encouragement and insightful feedback helped me achieve my
Objectives.

Lastly, I would like to thank my family members whose support helped me


complete the project within the deadline.

Functions Used in the Program:


1. input():
• Used to take input from the user for various actions such as choosing an option from the
menu and entering student details like Roll Number, Name, Class, Section, and Admission
Number.
2. print():
• Used throughout the program to display options, messages, and student details in the
console.
• Provides prompts to guide the user through the system, displaying information or
confirmations like "Student Added Successfully!" or "Student not found."

3. if / elif / else Statements:
• Used for conditional branching, deciding which operation to perform based on the user’s
choice.
• Controls the flow of the program by determining which block of code is executed (e.g.,
adding, viewing, editing, deleting students).
4. Dictionary Operations:
• students[roll_no] = {...}:
• Adds or updates a student’s details in the students dictionary, using the Roll
Number as the key.
• del students[roll_no]:
• Deletes a student’s record from the dictionary based on their Roll Number.
• students.items():
• Used to loop through all the students in the dictionary to display or process their
information.
5. or Operator:
• In the Edit Student (Option 3) section, the or operator is used to retain the current value if
the user leaves an input field blank (e.g., name = input("Enter Name: ") or
students[roll_no]["Name"]).
• This ensures that if the user doesn’t provide new input, the old value remains unchanged.
6. break:
• Used to exit the while True loop when the user selects Option 6 (Exit), terminating the
program
• .
7. Nested Loops:
• Used in both View Students (Option 2) and Display All Students (Option 5) to iterate over
the dictionary keys and values. It allows displaying student details in a formatted manner.

8. else Block for Error Handling:
• Used in multiple places to handle cases when a student isn’t found. For example, if the Roll
Number entered for deletion or editing doesn’t exist in the dictionary, an appropriate error
message is displayed ("Student not found.").

CODE
students = {
"101": {
"Name": "Rohit Sivastav",
"Class": "11th",
"Section": "A",
"Admission Number": "ADM001"
},
"102": {
"Name": "Anush Malik",
"Class": "12th",
"Section": "B",
"Admission Number": "ADM002"
},
"103": {
"Name": "Anku Kumar",
"Class": "9th",
"Section": "C",
"Admission Number": "ADM003"
},
"104": {
"Name": "Akshay Kumar",
"Class": "11th",
"Section": "A",
"Admission Number": "ADM004"
}
}

while True:
print("\nOptions:")
print("1. Add Student")
print("2. View Students")
print("3. Edit Student")
print("4. Delete Student")
print("5. Display All Students")
print("6. Exit")

choice = input("Enter your choice: ")

if choice == "1":
roll_no = input("Enter Roll No: ")
name = input("Enter Name: ")
student_class = input("Enter Class: ")
section = input("Enter Section: ")
admission_number = input("Enter Admission Number: ") # Fixed variable name typo
students[roll_no] = {
"Name": name,
"Class": student_class,
"Section": section,
"Admission Number": admission_number
}
print("Student Added Successfully!")

elif choice == "2":


if students:
for roll, details in students.items():
print(f"\nRoll No: {roll}")
for key, value in details.items():
print(f"{key}: {value}")
else:
print("No students found.")

elif choice == "3": # Editing student details


roll_no = input("Enter Roll No to Edit: ")
if roll_no in students:
print("Enter new details (leave blank to keep current value)")
name = input("Enter Name: ") or students[roll_no]["Name"]
student_class = input("Enter Class: ") or students[roll_no]["Class"]
section = input("Enter Section: ") or students[roll_no]["Section"]
admission_number = input("Enter Admission Number: ") or students[roll_no]["Admission Number"]
students[roll_no] = {
"Name": name,
"Class": student_class,
"Section": section,
"Admission Number": admission_number
}
print("Student Details Updated!")
else:
print("Student not found.")
elif choice == "4": # Deleting a student
roll_no = input("Enter Roll No to Delete: ")
if roll_no in students:
del students[roll_no]
print("Student Deleted Successfully!")
else:
print("Student not found.")

elif choice == "5":


if students:
print("\nAll Students:")
for roll, details in students.items():
print(f"\nRoll No: {roll}")
for key, value in details.items():
print(f"{key}: {value}")
else:
print("No students to display.")

elif choice == "6":


print("Exiting Program...")
break

else:
print("Invalid Choice! Try Again.")

You might also like