Instructions
Sure, here's a beginner-level Python
assignment that involves creating a
program to manage student attendance
at a school. This assignment assumes
that students have unique IDs, and
it focuses on basic input/output and
conditional statements.
**Assignment: Student Attendance System**
**Instructions:**
You have been tasked with creating a
simple student attendance system for
a school. Your program should allow
the user to mark students as present
or absent and then display the
attendance status for each student.
Follow the steps below to complete
the assignment:
1. Create an empty dictionary called
`student_attendance` to store the
attendance status of each student.
The keys of the dictionary will
be the student IDs (which you can
assume to be unique), and the
values will represent the
attendance status (either
"Present" or "Absent").
2. Implement a function called
`mark_attendance` that takes two
parameters: the `student_id` and
`status` (which can be either "P"
for "Present" or "A" for "Absent").
The function should update the
attendance status of the given student.
3. Implement a function called
`display_attendance` that displays
the attendance status of all students.
It should go through the `student_attendance`
dictionary and print out each student's ID
and attendance status.
4. In your main program, prompt the user
to perform the following actions:
- Mark attendance for a student by
entering the student's ID and their
attendance status ("P" or "A").
- Display the attendance status of
all students.
5. Use a loop to allow the user to
continuously interact with the program
until they choose to exit.
**Grading Criteria:**
- Correct implementation of the
`student_attendance` dictionary.
- Correct implementation of the
`mark_attendance` function.
- Correct implementation of the
`display_attendance` function.
- Proper user interface for
marking attendance and displaying
information.
- Correct usage of loops and
conditional statements.
- Neat and organized code with appropriate comments.
**Sample Output:**
```
Student Attendance System
1. Mark Attendance
2. Display Attendance
3. Exit
Enter your choice: 1
Enter student ID: 101
Enter attendance status (P/A): P
Attendance marked for student 101.
Enter your choice: 1
Enter student ID: 102
Enter attendance status (P/A): A
Attendance marked for student 102.
Enter your choice: 2
Attendance:
Student ID: 101 - Status: Present
Student ID: 102 - Status: Absent
Enter your choice: 3
Goodbye!
```