0% found this document useful (0 votes)
6 views5 pages

Student Management System Python HW

This document outlines the first homework assignment for the Programming Concepts CMPS 151 course, due on April 8, 2025. Students are required to develop a Student Management System using Python, adhering to specific guidelines regarding originality, allowed features, file naming, and program structure. The assignment includes detailed requirements for various functionalities such as adding students and courses, enrolling students, and calculating grades, along with a rubric for grading.

Uploaded by

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

Student Management System Python HW

This document outlines the first homework assignment for the Programming Concepts CMPS 151 course, due on April 8, 2025. Students are required to develop a Student Management System using Python, adhering to specific guidelines regarding originality, allowed features, file naming, and program structure. The assignment includes detailed requirements for various functionalities such as adding students and courses, enrolling students, and calculating grades, along with a rubric for grading.

Uploaded by

The Boss
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Programming Concepts CMPS 151

HW #1
(Spring 2025)
Name, ID, Section: Programming Concepts CMPS 151
Course
Instructor Name: Dr Osama Halabi

Due: April 8, 2025 (end of day)


HW Info _______

Grade: 100 marks 100


Student Name:

Student
Student ID:

Important Instructions: (read carefully)

• Originality & Academic Integrity

• Your submission must be your own work.


• All assignments will be checked for originality using plagiarism detection software.
• A high similarity with other submissions will be treated as plagiarism, leading to a zero
grade and a formal report to the department.

• Allowed Features & Libraries

• You are only permitted to use Python features and libraries covered in class so far.
• The use of unauthorized libraries or advanced features is strictly prohibited.

• File Naming & Submission Guidelines

• Your Python file must be named “[Link]”.


• Upload your file to Blackboard before the deadline.
• Only Python (.py) files are accepted; any other file format will not be graded.

• Program Structure & Function Modularity

• Your program should be structured using functions.


• Each menu option from 1 to 8 must be implemented as a separate function.
• Additionally, you must have a main function to display the menu and manage user
interactions.
• You are encouraged to create additional helper functions to improve code clarity,
efficiency, and reusability.
Multi-File Student Management System
Your task is to develop a Student Management System that stores and processes student records
across multiple files. Each file will store a different data type, helping students learn how to manage
multiple data sources.

Data Storage Files


The system will use the following three text files to store data:
1. [Link] – Stores student IDs and names

2. [Link] – Stores course names

3. [Link] – Stores grades assigned to students


Program Requirements
When the program starts, it should display the following menu:
1. Add a new student
2. Add a new course
3. Enroll a student in a course and assign a grade
4. Display all students
5. Display all courses
6. Calculate average grade for a student
7. Find the highest-scoring student in a course
8. Exit
The menu should be displayed repeatedly until the user selects option 8 (Exit).

Hint:
There are many operations that will be repeated in different options, for example, you need to validate
the student ID or the course name multiple times. Therefore, it will be easier to build helper functions
for these tasks so that you can just call them each time you need them. For example, you can create
functions such as:
- `def student_exists(student_id):` to check if a student exists
- `def course_exists(course_name):` to check if a course exists
- `def validate_grade(grade):` to ensure grades are between 0 and 100

Using helper functions will make your code more modular, readable, and reusable.

Option 1: Add a New Student


1. Ask for Student ID.
- Validate that it is a numeric value.
- Check if the ID already exists in [Link].
2. Ask for Student Name.
- Ensure it contains only letters and spaces.
3. Store student details in [Link].
4. Display a success message.

Option 2: Add a New Course


1. Ask for Course Name.
- Validate it contains only letters.
- Check if it already exists in [Link].
2. Store course details in [Link].
3. Display a success message.

Option 3: Enroll a Student


1. Ask for Student ID.
- Validate that it exists in [Link].
2. Ask for Course Name.
- Validate that it exists in [Link].
3. Ask for Grade.
- Validate it is between 0 and 100.
4. Store enrollment details in [Link].
5. Display a success message.

Option 4: Display All Students


1. Open and read [Link].
2. Display all students in a formatted way.
3. Handle empty files appropriately.

Option 5: Display All Courses


1. Open and read [Link].
2. Display all courses in a formatted way.
3. Handle empty files appropriately.

Option 6: Calculate Average Grade


1. Ask for Student ID.
- Validate existence in [Link].
2. Retrieve all grades for that student.
3. Compute the average.
4. Display the result.

Option 7: Find the Highest-Scoring Student in a Course


1. Ask for Course Name.
- Validate existence in [Link].
2. Search [Link] for the highest grade.
3. Retrieve and display the student’s name.
4. Handle cases where no grades exist.

Option 8: Exit
Terminate the program.
Rubric (100 Marks)
Criterion Marks Details
Option 1: Add a New Student 10 - Validates student ID is numeric and unique.
- Ensures student name contains only letters
and spaces.
- Properly appends the new student to
[Link].
Option 2: Add a New Course 10 - Validates course name contains only letters.
- Ensures the course does not already exist in
[Link].
- Properly appends the new course to
[Link].
Option 3: Enroll a Student in a Course 15 - Ensures student ID exists in [Link].
and Assign a Grade - Ensures course exists in [Link].
- Validates grade is a number between 0 and
100.
- Properly appends the record to [Link].
Option 4: Display All Students 10 - Reads from [Link].
- Displays students in a clear format.
- Handles the case where no students are
recorded.
Option 5: Display All Courses 10 - Reads from [Link].
- Displays all courses correctly.
- Handles the case where no courses are
recorded.
Option 6: Calculate Average Grade for a 15 - Ensures student ID exists in [Link].
Student - Reads all grades for the student from
[Link].
- Correctly computes the average grade.
- Displays an appropriate message if the
student has no grades.
Option 7: Find the Highest-Scoring 15 - Ensures course exists in [Link].
Student in a Course - Searches [Link] for the highest grade
in the given course.
- Retrieves and displays the student’s name
from [Link].
- Handles the case where no grades exist for
that course.
File Handling (Correct Usage & 10 - Properly opens, reads, writes, and appends to
Updates) files.
- Ensures files are closed correctly.
- Handles missing files without errors.
Input Validation & Error Handling 5 - Ensures all inputs are properly validated.
- Displays appropriate error messages for
invalid inputs.

You might also like